You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/11/16 02:31:44 UTC

DO NOT REPLY [Bug 4908] New: - XPath's text() and node() selectors get confused by CDATA sections

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4908>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4908

XPath's text() and node() selectors get confused by CDATA sections

           Summary: XPath's text() and node() selectors get confused by
                    CDATA sections
           Product: XalanJ2
           Version: 2.2.x
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xpath
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: mschilling@edgility.com


For example, for the document:

<?xml version="1.0"?>
<doc>
This is the first line.
<element/><![CDATA[A CDATA section.]]>
This is the last line.
</doc> 

XPath sees "/doc" as having only three child nodes: a text node, an element, and
a CDATA node.  It loses the final text node.  Pertrubing this example can lose
the CDATA node and any text nodes following it.

Even when the node selectors fail, the string() function on the parent node
seems to find all of the text and correctly concatenate it.