• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Another XML Conversion Problem

 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • 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:

 
Paul Clapham
Sheriff
Pie
Posts: 20739
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Pie
Posts: 20739
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Now I see. I have fixed my XSL file and see all the output that I expected. Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic