W3C home > Mailing lists > Public > w3c-ietf-xmldsig@w3.org > April to June 2002

RE: Additional test cases for Exclusive XML Canonicalization

From: Gregor Karlinger <gregor.karlinger@iaik.at>
Date: Wed, 3 Apr 2002 17:29:28 +0200
To: "'NACHIMUTHU,PALANIAPPAN \(HP-Cupertino,ex1\)'" <npal@hp.com>
Cc: "'XMLSigWG'" <w3c-ietf-xmldsig@w3.org>
Message-ID: <020d01c1db24$5c06ce20$5b00a8c0@iaik.at>
Palani,

the additionalNSPrefixes tell you which namespaces the prefixes
used in the XPath expression are bound to.

Where to use it depends on how you evaluate the XPath expression:

In the default case, Xalan uses the context node to resolve prefixes
in the XPath epression: The namespace declarations in scope for the
context nodes are used to determine the namespace a prefix is bound to.

If this is not sufficient for your scenario, you have to provide your
own implementation of the interface org.apache.xml.utils.PrefixResolver;
best is to derive from class org.apache.xml.utils.PrefixResolverDefault,
which is the default resolver Xalan uses. You can tell Xalan to use
your prefix resolver by using constructor 
org.apache.xpath.XPath(String, SourceLocator, PrefixResolver, int).

HTH, Gregor

> -----Original Message-----
> From: w3c-ietf-xmldsig-request@w3.org 
> [mailto:w3c-ietf-xmldsig-request@w3.org] On Behalf Of 
> NACHIMUTHU,PALANIAPPAN (HP-Cupertino,ex1)
> Sent: Wednesday, April 03, 2002 1:39 AM
> To: 'Gregor Karlinger'
> Cc: 'XMLSigWG'
> Subject: RE: Additional test cases for Exclusive XML Canonicalization
> 
> 
> This is probably a newbie question. In the examples 2, 3 and 
> 4 there's an additionalNSPrefixes value next to the xpath 
> expression. Where shd this be used, and how? Is it supposed 
> to be passed to the XPath evaluator? (I don't see an API to 
> pass multiple namespace nodes in the Xalan XPath
> implementation...)
> 
> regards,
> Palani
> 
> -----Original Message-----
> From: Gregor Karlinger [mailto:gregor.karlinger@iaik.at]
> Sent: Monday, April 01, 2002 8:52 PM
> To: reagle@w3.org
> Cc: 'XMLSigWG'
> Subject: RE: Additional test cases for Exclusive XML Canonicalization
> 
> 
> Joseph,
> 
> the XPaths I have provided for my examples are node tests in 
> the sense of the XPath Transform specified in XMLDSIG. 
> 
> So, if you take the well-known ;-) "//. | //@ | 
> //namespace::*" and add my XPath expression as its node test, 
> you should get the right results.
> 
> /Gregor
> 
> > -----Original Message-----
> > From: w3c-ietf-xmldsig-request@w3.org
> > [mailto:w3c-ietf-xmldsig-request@w3.org] On Behalf Of Joseph Reagle
> > Sent: Friday, March 29, 2002 11:02 PM
> > To: Gregor Karlinger
> > Cc: XMLSigWG
> > Subject: Re: Additional test cases for Exclusive XML 
> Canonicalization
> > 
> > 
> > On Tuesday 26 March 2002 06:32, Gregor Karlinger wrote:
> > >   2. Apply a XPath Transform with the appropriate XPath
> > >      (specified in a comment in the test case file)
> > 
> > Hi Gregor,
> > 
> > I'm a little confused on this note. When I pass your xpath 
> expression
> > 
> >   test_c14n.py -i iaikTests.example1.xml -x "self::Parent or
> >   (parent::Parent and not(self::Child)) or self::GrandChild or
> >   parent::GrandChild"
> > 
> > I get a (not  very useful) error [1]. But I'd still expect and error
> > because I'm not sure which BNF productions you are expecting 
> > this XPath 
> > expression to match?
> > 
> > However, the following does work and agrees with your result
> > for test 1:
> > 
> >   test_c14n.py -e -i iaikTests.example1.xml 
> >   -x "(//. | //@* | //namespace::*)[self::Parent or (parent::Parent
> >    and not(self::Child)) or self::GrandChild or parent::GrandChild]"
> > 
> > 
> > [1]     _in_subset = lambda subset, node: subset is None or 
> > node in subset
> > TypeError: 'in' or 'not in' needs sequence right argument
> > 
> > 
> 
> 


Received on Wednesday, 3 April 2002 10:38:09 GMT

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