IntelliJ Java IDE
The moose likes Product and Other Certifications and the fly likes node() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Product and Other Certifications
Reply Bookmark "node()" Watch "node()" New topic
Author

node()

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
Hema Menon
Ranch Hand

Joined: Oct 29, 2000
Posts: 569
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


~hm
 
 
subject: node()
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture