Re: parsing an inner Xml inside XML



On 5 янв, 18:07, kris <ramavelampa...@xxxxxxxxx> wrote:
hi,

I have a requirement to parse an XML which contains
another xml as a string content. I am able to parse the parent xml.
when I am parsing the second xml I am getting the following exception.
I have used CDATA to mark the string. And I have given the prolog
inside the inner xml which under one tag in the parent XML. I tried
without prolog also.

RdCanL::parseCanonical::XML EXCEPTION
org.apache.xmlbeans.XmlException: error: XML declaration is not well-
formed
at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:
3467)
at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:706)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:
690)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:
677)
at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoader-Base.java:
208)

If you use XML Beans to parse inner xml string, you should wrap
this xml string with <xml-fragment>...</xml-fragment> tags.
.



Relevant Pages