• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger
  • Frits Walraven


Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<abc att1="xyz"/>
What will the test evaluate to if the following expression is applied on the above element?
<if test="node()"> </if>
XML@Whiz says about this: The test condition will evaluate to false as the element <abc> has no children or text element as its children, that's why its not a node, having attribute doesn't qualify an element as a node.
Is this correct? Can't find any source for good explanaition. Thanks for a hint...
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
node() test selects all nodes in the current context, regardless of the type. This includes elements, text, comments, processing instructions, attributes and namespace nodes. I guess hence it would be incorrect to say the test result is false.
Tell me how it all turns out. Here is a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic