Hi Jorg, Sorry about the XStream typo, my email likes to autocorrect.
I ran the test using each of the StaxDriver Impls you suggested and here are the results: StaxDriver = Fail BEAStaxDriver = Success WstxDriver = Fail SjsxpDriver = Success To add to my confusion I checked out the xstream source and ran the unit tests for the StaxReaderTest and it passed. I am using xstream 1.4.3. Also to confirm Xstream does not support writing CDATA? So I will have to extend say the StaxWriter to do so since the XMLStreamWriter supports it. Thanks, Keith On 2/27/13 12:08 PM, "Jörg Schaible" <joerg.schai...@gmx.de> wrote: >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 > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email