question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Property WstxInputProperties.P_VALIDATE_TEXT_CHARS unrecognized

See original GitHub issue

Trying to use the lib (v5.0.3) because it was intend to have a feature to ignore invalid characters in xml text, but in fact it is not there: The code: XMLInputFactory2 f = (XMLInputFactory2)XMLInputFactory2.newInstance(); f.setProperty(WstxInputProperties.P_VALIDATE_TEXT_CHARS, Boolean.FALSE); Produces the following error: java.lang.IllegalArgumentException: Unrecognized property ‘com.ctc.wstx.validateTextChars’ at com.ctc.wstx.api.CommonConfig.reportUnknownProperty(CommonConfig.java:168) at com.ctc.wstx.api.CommonConfig.setProperty(CommonConfig.java:159) at com.ctc.wstx.api.ReaderConfig.setProperty(ReaderConfig.java:35) at com.ctc.wstx.sr.BasicStreamReader.setProperty(BasicStreamReader.java:1306)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
cowtowncodercommented, Oct 3, 2017

Hmmh. That is certainly unexpected… and does not appear to be tested or used. I will need to investigate what is the background story here.

Thank you for reporting this.

1reaction
ltuchcommented, Nov 24, 2018

I created a workaround at https://github.com/ltuch/staxtest which demonstrates a method that I use to ignore the invalid XML characters - this uses a FilterInputStream to strip out the bad characters.

Edit: after a bit of thinking I think this workaround has limitations in that it won’t work with UTF-16 and possibly other encodings.

Edit 2: I updated the workaround to use a filtered InputStreamReader. Don’t think this is the most elegant solution, so would be interested in finding a better solution than my hacks 😃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - xml validation with StAX: Unrecognized property 'javax ...
We found two solutions to this problem. One option is to thinly wrap the XmlStreamReader in a new class which will ignore the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found