Hi Jörg,
thank you for your post. Complete stack trace:
com.thoughtworks.xstream.io.StreamException: : entity reference names
can not start with character '&' (position: START_TAG seen
...sVerifyTagsArray(a.getVerifyTagsDefault())}if(a.debug||(a.verify&&...
@1:1722019)
at
com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
at
com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
at
com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:135)
at
com.thoughtworks.xstream.io.xml.AbstractPullReader.getValue(AbstractPullReader.java:180)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:41)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at
com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier.copy(HierarchicalStreamCopier.java:47)
at abstraction.XmlWriter.convertToJson(XmlWriter.java:270)
-- Stefan
On 14.11.2012 13:12, Jörg Schaible wrote:
> Hi Stefan,
>
> Stefan Bühlmann wrote:
>
>> Hi,
>>
>> I am using xstream to generate a json out of an xml by using:
>>
>> HierarchicalStreamReader sourceReader = new XppReader(new
>> BufferedReader(new FileReader("report.xml")), new MXParser());
>> JettisonMappedXmlDriver jettisonDriver = new JettisonMappedXmlDriver();
>> HierarchicalStreamCopier copier = new HierarchicalStreamCopier();
>> copier.copy(sourceReader, jettisonDriver.createWriter(new
>> BufferedWriter(new FileWriter("report.json"))));
>>
>> For & within CDATA (valid XML) I get the following exception:
>>
>> com.thoughtworks.xstream.io.StreamException: : entity reference names
>> can not start with character '&' (position: START_TAG seen
>> ...sVerifyTagsArray(a.getVerifyTagsDefault())}if(a.debug||(a.verify&&...
>> @1:1722019)
>> at
>>
> com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
>>
>> Any ideas how to make XppReader to parse the CDATA correctly?
>
> Please post the complete stack trace.
>
> - 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