W3C home > Mailing lists > Public > w3c-ietf-xmldsig@w3.org > July to September 2001

RE: Re: Re: XPath Expression

From: Gregor Karlinger <gregor.karlinger@iaik.at>
Date: Mon, 6 Aug 2001 09:22:40 +0200
To: "Dournaee, Blake" <bdournaee@rsasecurity.com>, <w3c-ietf-xmldsig@w3.org>
Cc: <reagle@w3.org>
Message-ID: <LBEPJAONIMDADHFHAEAOKEPICHAA.gregor.karlinger@iaik.at>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:21:36 UTC