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
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply 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: 111
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: 13842

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: 111
That worked, thank you! Namespaces are slowly coming into focus.
 
 
subject: why no matches past the "/" and no output?
 
Threads others viewed
XSL
XSLT value-of parameter not works as xml value
to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not
Creating a chart using xslt
Problem with XSL.
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com