You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Radu Preotiuc-Pietro <ra...@bea.com> on 2008/03/11 21:36:23 UTC

Re: embedded xmlbeans object inside another xmlbeans object throwing CDATA error

Hm, so you are saving XML to String, doing some string manipulation
(concatenation qualifies), then you try to parse that back to XML and
you get parsing errors...

One thing that could maybe help is to turn CDATA off completely when
saving the document, using XmlOptions.setSaveCDataEntityCountThreshold
and set the threshold to a very high number.

Other than that, I can say that the chance is literally 0 that XMLBeans
generates non-well-formed XML or on the other side, the parser is not
able to parse well-formed XML.

Hope this helps,
Radu

On Wed, 2008-03-05 at 17:01 -0700, james_ wrote:
> This is a bit of a weird situation, so please bear with me: I'm using
> a custom ESB platform and I'm trying to send an xml object off to a
> service where it'll be processed and turned back into an object. I get
> passed a org.w3c.dom.Document object (which is actually an xml-ized
> object created using xmlbeans) and I turn that into a string, then set
> that as a payload inside another, completely separate xmlbeans object.
> I'm able to turn that whole mess into a string and send it off through
> the network, but after unmarshalling the outer object my program
> throws an exception when trying to get the payload. However! I'm able
> to get other fields in the string without problems. The XML looks like
> this:  something somethingElse  ...continued...]]> The error I get is
> that there's illegal cdata in the field, and XMLbeans doesn't seem
> able to parse it. However, this strikes me as a bit weird -- I'm not
> closing the CDATA field and after I tried simply escaping all of the <
> and > characters, the program still died (for some reason CDATA still
> surrounded the entire payload). I'm using jdk 1.5 and using ant's
> xmlbeans task to compile the xmlbeans libraries. I saw a few other
> posts that mentioned similar problems, but I don't think I'm doing
> anything unusual or that could cause this kind of strangeness. I did
> try using the latest version of xercesImpl.java to see if that would
> fix the problem, but it didn't seem to help (I was still building in
> the same fashion as before though, so perhaps I need to replace
> xercesImpl somewhere else?) Any suggestions are very much appreciated.
> Thanks for your time :) 
> 
> ______________________________________________________________________
> View this message in context: embedded xmlbeans object inside another
> xmlbeans object throwing CDATA error
> Sent from the Xml Beans - User mailing list archive at Nabble.com.

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

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