Pascal Landry wrote:
> Hi !
> I wanna know if it's possible to check if a node is present or not in the
> XML document...
Yes, it is possible. Assuming you're using XSLT or another XPath-aware
application, you can do something like this:
<!-- Match a parent only if it has a child3 -->
<!-- Display value of child3 -->
The simple predicate form [nodename] equals true if nodename exists,
false otherwise, and the node(s) for which the value is true are
selected. (Note that there's no axis included, so it defaults to
child::. I.e., [nodename] is the same as [child::nodename].)
Of course this won't help you at all if you're *not* using an
XPath-aware application. :)
John E. Simpson | "For a while I didn't have a car... I
http://www.flixml.org | had a helicopter... no place to park it,
XML Q&A: www.xml.com | so I just tied it to a lamp post and
| left it running. <slow glance upward>"
| (Steven Wright)