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

RE: XPath question

From: John Boyer <jboyer@PureEdge.com>
Date: Thu, 7 Sep 2000 10:25:58 -0700
To: "Gregor Karlinger" <gregor.karlinger@iaik.at>, "XMLSigWG" <w3c-ietf-xmldsig@w3.org>
Hi Gregor,

Actually, it doesn't mean that you can't match elements that are in the
default namespace.  For an example, see [1]


In the first code example, the Signature is in the default namespace of
&dsig;.  However, the XPath expression has the dsig prefix declared, and the
match to the Signature is done using dsig:Signature.  Thus, matching
elements in the default namespace can be done by setting up a prefix with
the same URI as the default namespace.

Incidentally, if [1] resolves to a draft that mentions the subexpression
(//. | //@* | //namespace::*), note that you no longer need this
subexpression as a result of the change of processing model.

John Boyer
Development Team Leader,
Distributed Processing and XML
PureEdge Solutions Inc.
Creating Binding E-Commerce
v: 250-479-8334, ext. 143  f: 250-479-3772
1-888-517-2675   http://www.PureEdge.com <http://www.pureedge.com/>

-----Original Message-----
From: w3c-ietf-xmldsig-request@w3.org
[mailto:w3c-ietf-xmldsig-request@w3.org]On Behalf Of Gregor Karlinger
Sent: Thursday, September 07, 2000 4:39 AM
Subject: XPath question

Hi all,

Having read the XPath Rec, I found the following paragraph in
section 2.3 about node tests:

  "A QName in the node test is expanded into an expanded-name using the
  declarations from the expression context. This is the same way expansion
is done
  for element type names in start and end-tags except that the default
  declared with xmlns is not used: if the QName does not have a prefix, then
  namespace URI is null (this is the same way attribute names are expanded).
  is an error if the QName has a prefix for which there is no namespace
  declaration in the expression context."

Does this really mean, that I cannot select a node which has a default
declared? Consider the following example:

<NS1:DocElement xmlns="http://anywhere.com/default"

What should the XPath expression "/descendant::SecondChild" provide as

  a) An empty node set, since the expression should select a node with
     an expanded-name constisting of an empty namespace URI and a local part
     equal to "SecondChild"?

  b) A node set consisting of a single element node, since the expression
     should select a node with an expanded-name constisting of the default
     namespace URI ("http://anywhere.com/default") and a local part equal
     to "SecondChild"?

If a) is the answer, we should add a few sentences in the spec, that we
to introduce a namespace prefix for the XML-Signature elements, and not to
the default namespace for them. Otherwhise it would not be possible to
such elements with XPath expressions.

Regards, Gregor
Gregor Karlinger
Phone +43 316 873 5541
Institute for Applied Information Processing and Communications
Received on Thursday, 7 September 2000 13:26:08 UTC

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