Hi!

I'm experiencing some curiosity when parsing CDATA. I was not able to
figure out the exact cause but when indenting the cdata tag and/or
adding whitespaces, linefeeds Xerces 2.6.2  becomes unable to parse the
file properly, i.e. the selected Node is actually empty (not null):

        final DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
        final Document doc = builder.parse(
getClass().getResourceAsStream("file.xml" ));           final Node n =
XPathAPI.selectSingleNode( doc, "/queries/[EMAIL PROTECTED]'foo']/text()" );
        System.out.println( n.getNodeValue() );

<queries>
        <query id="foo"><![CDATA[ 
                        SELECT 
                                foo
                        FROM
                                bar
        ]]></query>
</queries>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to