aspose file tools*
The moose likes XML and Related Technologies and the fly likes Another XML Conversion Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Another XML Conversion Problem " Watch "Another XML Conversion Problem " New topic
Author

Another XML Conversion Problem

Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: May 06, 2003
Posts: 325
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: May 06, 2003
Posts: 325
Now I see. I have fixed my XSL file and see all the output that I expected. Thank you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Another XML Conversion Problem