Hi Keith,

Wire, Keith C wrote:

> Hi Jorg,
> 
> I created a simple test as you recommended, and the results were as I
> expected. The CDATA contents were not read.  Here is the test:
> 
> @Test
> Public void testReadCdata(){
>   Xstream xstream = new Xstream(new StaxDriver());

XStream ?

>   String contents = "<tag>my data conents</tag>";
>   String xml = "<string><![CDATA[" + contents + "]]></string>";
>   String results = (String) xstream.fromXML(xml);
>   assertEquals(contents, results);
> }
> 
> "results" is always empty.
> I'm using Oracle Java 1.6_033.

I am running 1.6.0_41, but that should not make any difference. All XML 
drivers can read this flawlessly.

Can you replace StaxDriver and run this test with BEAStaxDriver|WstxDriver|
SjsxpDriver one time each and report what happens?

> I also wrote a test to write "CDATA" and it is always encoding "<" & ">"
> characters like "lt&;", etc.

XStream does not write CDATA.

> What am I doing wrong?

Just from the code here - nothing. What version of XStream you're running?

- Jörg



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to