What does org.apache.xmlbeans.XmlException mean with the message "Unexpected element: CDATA"?

I am trying to parse and load an XML document, however I get this exception when I call the parse method in a class that extends XmlObject. Unfortunately, this does not give me any ideas about which element is unexpected, and this is my problem.

I cannot share this code, but I can try to provide additional information if necessary.

+2
source share
3 answers

Unable to exchange codes or input, you can consider the following approach. This is a very common dichotomous approach to diagnosis , I'm afraid, and indeed you can easily start it ...

Try to reduce the size of the input XML by deleting parts of it, ensuring that the underlying XML document remains well formed and possibly valid (if validation is required in the parser setting). If you maintain validity, this may require a modification of the [copy] of the Scheme (DTD or another), since the mandate elements can be removed during the cut and try approach ... BTW, the error message seems to hint more at the validation question , which is the main problem of the statement of correctness.

, , ( , ) , .

, , . " ": XML- ? (, : , ...)

, ...

+1

, parse(); (File/InputStream/String) ..

+1

The exception is the length of the XML file. If you add or remove one character from a file, the parser will succeed.

The problem occurs in the third PiccoloLexer library, which XMLBeans relies on. It was fixed in edition 959082, but was not applied to the xbean 2.5 jar.

XMLBeans - problem with XML files if the length is exactly 8193 bytes

XMLBean Jira Report

+1
source

All Articles