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

Re: Re: XPath Expression

From: <edsimon@xmlsec.com>
Date: Thu, 2 Aug 2001 10:57:14 -0400
Message-ID: <3B5F179F00002F16@mail.san.yahoo.com>
To: merlin <merlin@baltimore.ie>
Cc: reagle@w3.org, bdournaee@rsasecurity.com, w3c-ietf-xmldsig@w3.org
I'd certainly be keen to see the full working XPath expression if someone
wants to take up the challenge.  Merlin's suggestion, by itself, is not
the whole solution but only part as it returns a boolean, not nodes.  

In general, XPath is good at selecting nodes but was not really intended
for removing subnodes.  With current tools, I'd say removing subnodes is
best done with XSLT.

BTW, the XSLT I've presented below does actually do the trick.

Ed
-- Original Message --

>
>I'd guess that something like not ((name() = "URI") and parent::dsig:Reference)
>might work.
>
>merlin
>
>r/edsimon@xmlsec.com/2001.08.02/09:37:38
>>>>This would allow me to change the URI without altering the validity
of
>>the
>>>>signature.
>>>
>>>If it's being used in the Canonical XML context, remove the '//@*' from:
>>>         (//. | //@* | //namespace::*)
>>
>>
>>Correct me if I'm wrong but wouldn't the above remove ALL attributes,
not
>>just the one Blake wants removed.
>>
>>I'm not sure that there is an XPath solution but the solution in XSLT
would
>>look like this:
>>
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><xsl:stylesheet version="1.0" 
>>  xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"
>>  xmlns:xmlsig="http://www.w3.org/2000/09/xmldsig#">
>>
>><!-- Identity transform -->
>><xsl:template match="@*|node()">
>>  <xsl:copy>
>>    <xsl:apply-templates select="@*|node()"/>
>>  </xsl:copy>
>></xsl:template>
>>
>>
>><!-- Skip the Reference/@URI attribute -->
>><xsl:template match="xmlsig:Reference/@URI" priority="2"/>
>>
>>
>></xsl:stylesheet>
>>
>>
>>--------------------------------------------------


--------------------------------------------------
Ed Simon
XMLsec Inc.

Interested in XML Security Training and Consulting services?  Visit "www.xmlsec.com".
Received on Thursday, 2 August 2001 11:02:12 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.29 : Thursday, 13 January 2005 12:10:13 GMT