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

RE: Question for implementors: XPath model and CDATA sections

From: Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
Date: Tue, 12 Feb 2002 11:39:18 +0100
To: "'Christian Geuer-Pollmann'" <geuer-pollmann@nue.et-inf.uni-siegen.de>, <w3c-ietf-xmldsig@w3.org>
Message-ID: <008f01c1b3b1$865475f0$64981b81@iaik.at>
hi,

i just had a look into the XPath standard. i think it is a clear bug of
Xalan.

in "5.2 Element Nodes" one can read
... 
The string-value of an element node is the concatenation of the
string-values of all text node descendants of the element node in
document order.

and "5.7 Text Nodes" says
Character data is grouped into text nodes. As much character data as
possible is grouped into each text node: a text node never has an
immediately following or preceding sibling that is a text node. The
string-value of a text node is the character data. ...


even my common sense tells me that everything else does not make sense.

regards

  Karl

--

Karl Scheibelhofer, <mailto:Karl.Scheibelhofer@iaik.at>
Institute for Applied Information Processing and Communications (IAIK)
at Graz University of Technology, Austria, http://www.iaik.at and
http://jcewww.iaik.at
Phone: (+43) (316) 873-5540


> -----Original Message-----
> From: w3c-ietf-xmldsig-request@w3.org 
> [mailto:w3c-ietf-xmldsig-request@w3.org] On Behalf Of 
> Christian Geuer-Pollmann
> Sent: Tuesday, February 12, 2002 10:14 AM
> To: w3c-ietf-xmldsig@w3.org
> Subject: Question for implementors: XPath model and CDATA sections
> 
> 
> Hi all,
> 
> while playing arounf with Xalan/Xerces, I found a - hm 
> problem? - with 
> XPath. I read in a document which contains something like this:
> 
> <element>
> previous sibling text
> <![CDATA[
>     text in CDATA
> ]]>
> following sibling text
> </element>
> 
> 
> and use Xalan to select all Nodes by using the 
> c14n-with-comments expr: 
> (//. | //@* | //namespace::*). In the resulting NodeList, 
> there is only one 
> text node (the previous sibling). The CDATA section and the following 
> sibling do not show up in the result. In the bug-report I 
> opened for that 
> [1], there is stated by the Xalan developers:
> 
>   "So when you run an XPath against a DOM and
>    return text as a DOM node, we return the
>    _first_ such node in the contiguous text,
>    whether it's Text or CDATASection. It is
>    the caller's responsibility to check whether
>    additional text follows, if that's relevant
>    for your application."
> 
> So actually, I don't know whether this is right. Any 
> opinions? I guess this 
> is a problem that can have many of the Java based implementations?
> 
> Regards,
> Christian
> 
> 
> 
> [1] http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6329
> 
> 
> 
> 
Received on Tuesday, 12 February 2002 05:41:23 GMT

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