woodstox icon indicating copy to clipboard operation
woodstox copied to clipboard

Force XML version 1.1 override for parser

Open petr-k opened this issue 7 years ago • 3 comments

Hello, I have a XML file that has a prolog tagging the document to be in version=1.0, even though it contains some entities (namely ), which do not conform to 1.0, so I get an exception when parsing the file as expected.

Once I manually change the version in the prolog to 1.1, the file is parsed without errors.

My question is whether there's a way to force the parser to discard the prolog information to somehow always use XML 1.1 semantics, without the need to alter the original file. I'm using the SAX API.

Thanks.

petr-k avatar Nov 29 '16 13:11 petr-k

I don't think there is such functionality yet.

cowtowncoder avatar Nov 29 '16 18:11 cowtowncoder

I managed to deal with this with the help of an ugly reflection hack. Thanks anyway ;)

petr-k avatar Nov 29 '16 19:11 petr-k

@petr-k Ok; if you don't mind I'd like to keep this open -- it should be easy enough to implement at some point.

cowtowncoder avatar Nov 29 '16 19:11 cowtowncoder