aspose file tools
The moose likes XML and Related Technologies and the fly likes how do i check for the presence of a node through XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how do i check for the presence of a node through XML" Watch "how do i check for the presence of a node through XML" New topic
Author

how do i check for the presence of a node through XML

shoeb sayyed
Ranch Hand

Joined: Mar 14, 2010
Posts: 48
i need to check for the presence of the blob in the following XML file using XML




i tried using <xsl:if test="root/items/blob"> but it is not working can you suggest a solution


Thanks,
Shoeb
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19672
    
  10

Presumably, then, your context node wasn't the document element when you executed that element. You used a relative XPath expression there, which is relative to your context node. If you can't fix it to be relative to the actual context node at execution time, you could always use an absolute XPath expression.
 
 
subject: how do i check for the presence of a node through XML
 
It's not a secret anymore!