This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Non-existing node


> I have a (stupid?) question:
>
> What is returned when you try to reach a node that doesn't exist ?

If you reference a node that doesn't exist, the result is an empty node-set.

> Imagine the simplest xml possible:
>
> <xml></xml>

Actually that's far from simple; it's highly debatable whether or not this
is well-formed XML, since the XML specification states that names beginning
with "xml" are reserved for future standardisation...
>
> what I would like to know is what value is returned if I try
> to reach some
> node inside the xml, thus is:
>
> ...
> <xsl:if test="SomeNode=Whatever">
> ...
> </xsl:if>
> ...
>

The rules for "=", "!=", etc, mean that if you compare an empty node-set to
anything, using any of the six comparison operators, the result is false. In
fact, comparing two empty node-sets to each other also gives false.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]