Unexpected parsing error in CDATA block

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unexpected parsing error in CDATA block

Sebastien Degardin
I'm parsing an xml which contains a CDATA block and I get the following exception:

"Caused by: org.xmlpull.v1.XmlPullParserException: start tag unexpected character @ (position: TEXT seen ...<Mrell@do [mailto:[hidden email]]>  <Dn@... @9:100) 
at org.xmlpull.mxp1.MXParser.parseStartTag(MXParser.java:1803)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1127)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)"

for this:

"<ical-content><![CDATA[  DESCRIPTION:[mailto:[hidden email]]]  <Mrell@do [mailto:[hidden email]]>  <Dn@allo    ]]></ical-content>"

If I remove the first occurrence of double brackets if does work. it seems to me that xstream identify double brackets "]]" as the end of the CDATA block instead of "]]>

I'm using Java 6 and xstream 1.4.2

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected parsing error in CDATA block

Jörg Schaible-2
Hi Sebastian,

Sebastien Degardin wrote:

> I'm parsing an xml which contains a CDATA block and I get the following
> exception:
>
> "Caused by: org.xmlpull.v1.XmlPullParserException: start tag unexpected
> character @ (position: TEXT seen ...<Mrell@do [mailto:Mll@dk]>  <Dn@...
> @9:100)
>  at org.xmlpull.mxp1.MXParser.parseStartTag(MXParser.java:1803)
> at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1127)
>  at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)"
>
> for this:
>
> "<ical-content><![CDATA[
> DESCRIPTION:[mailto:[hidden email]]]  <Mrell@do
> [mailto:Mll@dk]>  <Dn@allo    ]]></ical-content>"
>
> If I remove the first occurrence of double brackets if does work. it seems
> to me that xstream identify double brackets "]]" as the end of the CDATA
> block instead of "]]>"
>
> I'm using Java 6 and xstream 1.4.2

unfortunately there's nothing XStream can do. This is a (known) error in the
Xpp3 parser and it seems that Xpp3 development is completely dead, I don't
even know where I should report it.

You will have to use a different parser engine (e.g kXML2 using the
KXml2Driver).

Cheers,
Jörg


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

    http://xircles.codehaus.org/manage_email