• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Another XML Conversion Problem

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am converting on another XML file using XSL. All the values within the <PreviewCareCoordinatorProfile> cannot be picked up. I am posting "part" of my input XML file, my XSL conversion file, and my output file below. If anybody would kindly point out my mistake. Thank you.

Input XML file (Part of it):

My XSL conversion file:


My output file:

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your namespace URI for the "vler" prefix in your XLST doesn't match the namespace URI for the "vler" prefix in the input XML. Since it's the URIs which are used for matching and not the prefixes, you don't match anything with that prefix.
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried what your suggested; for example, instead of , I changed it to . But, it did not work.

Maybe I do not understand what you suggested.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, apparently you have completely not understood the reason why you declare namespaces.

In your XSLT you declare the "vler" prefix to have the namespace URI of "http://mynamespace.com/schemas/vcp/0.1/health/UnstructuredC62/0.1/subset/vler/". So when you look
for a "vler:ServiceProvider" element, you are looking for a ServiceProvider element with that namespace URI.

In your input XML you do indeed have ServiceProvider elements. They also happen to use the "vler" prefix, but in that XML the "vler" prefix is declared to have the namespace URI
of "http://mynamespace.com/schemas/vcp/0.1/otherAdmin/CareCoordinatorProfile/0.2/subset/vler/0.2". Your XSLT code will not find those elements because it is not looking for
elements with that namespace URI.
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I see. I have fixed my XSL file and see all the output that I expected. Thank you.
reply
    Bookmark Topic Watch Topic
  • New Topic