• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

node()

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
<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...
Regards
Berny
 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
Later,
Hema
 
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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic