aspose file tools*
The moose likes XML and Related Technologies and the fly likes why no matches past the 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 "why no matches past the "/" and no output?" Watch "why no matches past the "/" and no output?" New topic
Author

why no matches past the "/" and no output?

Thomas Kennedy
Ranch Hand

Joined: Jan 20, 2008
Posts: 137
Given



and content.xsl:



It gets as far as the "/" template in content.xsl line 7 but it goes no further. In other words the <apply-templates> on line 8 finds no matches, and I get no output. Is it some namespace problem? Thank you.


Costs matter. Justice lies in processes not outcomes. Crime is caused by criminals.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Thomas Kennedy wrote:Is it some namespace problem?


Yes. Your "data" element name is in the default namespace, in other words in the "http://www.hp.com/dexix/content" namespace. But your stylesheet looks for "data" elements in no namespace, so it doesn't find any.

To fix that, change your stylesheet to declare the "http://www.hp.com/dexix/content" namespace and assign a prefix to it (i.e. don't make it the default namespace). You can use any prefix you like. Then change your stylesheet to search for "data" elements with that prefix, in otherwords to search for "data" elements in the "http://www.hp.com/dexix/content" namespace.
Thomas Kennedy
Ranch Hand

Joined: Jan 20, 2008
Posts: 137
That worked, thank you! Namespaces are slowly coming into focus.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why no matches past the "/" and no output?