RE: Re: Re: XPath Expression

Blake,

<BD>
XPath Expression: (//. | //@* | //namespace::*)[not (self::attribute and
(name()=URI) and parent::Reference)]

My transformed node-set was the same as the input node set. My input file
was decidedly simple:

<?xml version="1.0" encoding="UTF-8"?>
<Reference URI="foo"> Hello People! </Reference>

I was expecting to get:

<Reference> Hello People! </Reference>

But instead got:

<Reference URI="foo"> Hello People! </Reference>
</BD>

<GK>
I think that you assume that self::attribute selects acts as a node test,
i.e. that is selects the node if it is of type Attribute. But node tests
are available in XPATH only for comment, text, pi, and node, not for
attribute. What self::attribute actually does is to select the node if
its name equals "attribute". In your example, there is no such node, and
therefore the predicate [not(...)] is always true. This leads to the
result you mentioned.

Liebe Gruesse/Regards,
---------------------------------------------------------------
DI Gregor Karlinger
mailto:gregor.karlinger@iaik.at
http://www.iaik.at
Phone +43 316 873 5541
Institute for Applied Information Processing and Communications
Austria
---------------------------------------------------------------

<GK>

Received on Monday, 6 August 2001 03:22:25 UTC