RE: XPath Serialization

Hi TAMURA-san,

Actually, you didn't misunderstand.  The intent of URI="#something" is to
render the element identified as 'something' plus all of its descendants, as
well as their namespace and attribute nodes.  However, the corresponding
XPath that creates the proper node-set is a little harder because we are
using absence from the node-set to indicate omission from the output.  I
have not found a way in XPath to constrain the evaluation to the nodes at or
below the identified element without losing the namespace and attribute
nodes.  I would like to say something like:

id("something")/all-descendants-or-self::node()

but there is no such axis.  Further, there are syntactic limitations on
where the subexpression (//. | //@* | //namespace::*), which means all nodes
at or below the context node, can be placed.  For example, the following
appears to be illegal:

id("something")/(//. | //@* | //namespace::*)

The only way I've come up with so far of doing this is to scan every node of
the parse tree looking for nodes with ancestry (or self) that includes the
identified element.  The resulting expression is quite inefficient, but it
does the job:

(//. | //@* |
//namespace::*)[count(ancestor-or-self::*)=count(id("something") |
ancestor-or-self::*)]

John Boyer
Software Development Manager
PureEdge Solutions Inc. (formerly UWI.Com)
Creating Binding E-Commerce
jboyer@PureEdge.com


-----Original Message-----
From: w3c-ietf-xmldsig-request@w3.org
[mailto:w3c-ietf-xmldsig-request@w3.org]On Behalf Of TAMURA Kent
Sent: Thursday, May 25, 2000 1:02 AM
To: IETF/W3C XML-DSig WG
Subject: Re: XPath Serialization



In message "XPath Serialization"
    on 00/05/23, "John Boyer" <jboyer@PureEdge.com> writes:
> 5) There was some confusion about how to process the node-set.  I fixed
this
> by commenting that nodes are not processed more than once.  As part of the
> processing of an element E, its namespace declarations, attributes, and
> descendants are processed, so they are not visited again when E is
finished
> processing.

I misunderstood as all descendants were rendered ;-)

XPath serialization is used to serialize an element pointed
"#id-name" (in 4.3.3 the third paragraph.)  So, the following
dsig:Reference element digests only '<purchase xmlns=""></purchase>'.
Is this right?


<SignedPurchase>
  <purchase id="ORDER1">
    <item>ThinkPad</item>
    <price>195.00$</price>
  </purchase>

  <dsig:Signature xmlns:dsig="...">
    ....
  <dsig:Reference URI="#ORDER1">
    <dsig:DigestMethod ..../>
    <dsig:DigestValue>...</dsig:DigestValue>
  </dsig:Reference>
   ...
  </dsig:Signature>
</purchase>

--
TAMURA Kent @ Tokyo Research Laboratory, IBM

Received on Thursday, 25 May 2000 13:29:05 UTC