-
-
Notifications
You must be signed in to change notification settings - Fork 228
Elements containing <CDATA/> parsed incorrectly when at the end of another element #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(NOTE: updated on 13-Nov-2020) I don't think this is due to CDATA sections, and you definitely should not have to use One quick note: this
seemed incorrect: local name can and should not contain colon (it is namespace separator so local name should be "creator" -- "dc" is just prefix mapping to namespace URI) -- however, code does disable namespace handling so it might be ok. |
Another note: a potential problem is this:
since doing that will tend to hide problems that would otherwise be easier to troubleshoot. So in future it makes sense to NOT disable this feature, at least during figuring out problems: once things work it is ok to disable it for production. However I can see that this was done to skip "xmlns" declarations so that may be reasonable, although it is possible to alternatively use |
Looks like this passes for 2.12: it looks like skipping of |
Thanks!
Agreed, though unfortunately, not disabling isn't an option, since I don't control the quality of the source XML, and I need to read what I can. |
@0xe1f understood, that's why I mentioned "during testing / troubleshooting". For production it may make sense to be more forgiving. |
I'm experiencing a really odd issue while trying to deserialize some basic XML. Here's my setup:
POJOs:
XML I'm trying to parse:
Attempting to run this as-is yields the following error:
If I remove
<description/>
, the same error will be thrown for<content:encoded/>
. If I remove both elements, the errors go away - even though there are multiple otherCDATA
elements further up. If I move the two elements so that they occur before<guid/>
, the error goes away and both elements are parsed without any issues.If, to resolve the error, I add a constructor to
RssItem
that accepts aString
, that constructor will be called for both<description/>
and<content:encoded/>
, which seems highly unusual - it's almost as if those two are being parsed as separate<item/>
nodes themselves.I'm using version 2.11.2, though I've tried multiple other versions. I've also tried using
woodstox-core
, version 5.2.1.0, but the error persists. I've also tried marking up bothcontent
andencodedContent
@JacksonXmlCData
and@JacksonXmlText
, to no avail.The text was updated successfully, but these errors were encountered: