RE: XPath examples in the spec.

I wonder what the reason was for that exception.  It seems to me that a node
test which does not include a namespace prefix should use the default
namespace.

Nonetheless, the spec has made the exception, and it was the intent of the
example that the given Reference element be placed in a Signature element
with an xmlns set to &dsig; in accordance with our specification.

Therefore, I agree that the example needs to be tweaked, and I also agree
that your modification would suffice.  For the same of brevity, though, I
will probably tweak the example to be that given below unless there is some
objection:


<Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
    <XPath xmlns:dsig="&dsig;">
	(//. | //@* | //namespace::*)[not(ancestor-or-self::dsig:Signature)]
    </XPath>
</Transform>

I've modified the Xpath's initial evaluation context to include a namespace
declaration for dsig, which can then be used to namespace qualify the
Signature elements more compactly.

This will have an even better impact on the latter example as well as the
one for enveloped signature.  I should be able to incorporate this change
this Thursday.

***************************************
John Boyer,
Software Development Manager

PureEdge Solutions (formerly UWI.Com)
Creating Binding E-Commerce

v:250-479-8334, ext. 143 f:250-479-3772
1-888-517-2675  http://www.PureEdge.com
***************************************


-----Original Message-----
From: w3c-ietf-xmldsig-request@w3.org
[mailto:w3c-ietf-xmldsig-request@w3.org]On Behalf Of TAMURA Kent
Sent: Monday, June 19, 2000 5:44 PM
To: w3c-ietf-xmldsig@w3.org
Subject: XPath examples in the spec.


Chapter 6 of the spec. has some XPath examples.  The following
is one of them:

       <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
         <XPath>(//. | //@* |
//namespace::*)[not(ancestor-or-self::Signature)]
         </XPath>
       </Transform>

This expression has element name 'Signature' without a prefix.
Accoding to XPath 1.0, non-prefixed name like it must not have
namespace.  This example does not work because the Signature
element must have the 'http://www.w3.org/2000/02/xmldsig#'
namespace.

I think that we can write like '*[local-name()="Signature" and
namespace-uri() ="http://www.w3.org/2000/02/xmldsig#"' in such
cases.


Third paragraph of http://www.w3.org/TR/1999/REC-xpath-19991116#node-tests
	This is the same way expansion is done for element type
	names in start and end-tags except that the default
	namespace declared with xmlns is not used: if the QName
	does not have a prefix, then the namespace URI is null.

--
TAMURA Kent @ Tokyo Research Laboratory, IBM

Received on Monday, 19 June 2000 23:17:09 UTC