You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Thomas Börkel <tb...@ap-ag.com> on 2002/02/26 12:54:09 UTC

Bad bug in Xerces?

HI!

Consider the following XML, which is being built with 
dbf = DocumentBuilderFactory.newInstance();
db = dbf.newDocumentBuilder();
doc = db.parse(new InputSource(new StringReader(text))):

<convert><p0><![CDATA[100200]]></p0><p1><![CDATA[<Auswahl>\r\n<pos nr='1' menge='100'/>\r\n</Auswahl>]]></p1><p2><![CDATA[Auftrag]]></p2></convert>


If you write out the document after this with 
streamResult = new StreamResult(new StringWriter());
transformer = TransformerFactory.newInstance().newTransformer();      transformer.transform(new DOMSource(node), streamResult), then you get this:

<convert><p0><![CDATA[100200]]></p0><p1><![CDATA[100200<Auswahl>\r\n<pos nr='1' menge='100'/>\r\n</Auswahl>]]></p1><p2><![CDATA[Auftrag]]></p2></convert>


Clearly, the XML is damaged. And it's not the Transformer's fault, because if you iterate through the DOM, you see that the 2nd CDATA node really has the wrong data.


Anyone any idea, please? Am I doing something wrong?


Regards,
Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


very newnbie question

Posted by laurent <al...@wanadoo.fr>.
Sorry to bother you with a stupid question but i'd like to discover XERCES but can't test Xerces Counter.java sample code.

i've compiled sources on my win2K srevr and always get following error : unable to instatiate parser ( dom.wrappers.Xerces ) when i enter : java Counter http://localhost/test.xml

and can't reach miling list archive.







---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Bad bug in Xerces?

Posted by Andy Clark <an...@apache.org>.
Thomas Börkel wrote:
> Clearly, the XML is damaged. And it's not the Transformer's 
> fault, because if you iterate through the DOM, you see that 
> the 2nd CDATA node really has the wrong data.
> 
> Anyone any idea, please? Am I doing something wrong?

This looks like a bug in Xerces 2.0.0. But the problem goes
away when using the current code in CVS. There will probably
be a bug fix release coming out soon but if you can't wait
then extract the latest code from the repository and do a
fresh build.

-- 
Andy Clark * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org