This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.



Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Thomas Kennedy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked, thank you! Namespaces are slowly coming into focus.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!