FasterXML / woodstox

The gold standard Stax XML API implementation. Now at Github.
Apache License 2.0
220 stars 81 forks source link

'Element <root> has no attribute "verbose"' not thrown from RepairingNsStreamWriter when validating against a DTD schema #190

Open ppalaga opened 5 months ago

ppalaga commented 5 months ago

The same scenario is passing for ValidatingStreamReader in the following test:

https://github.com/FasterXML/woodstox/blob/5ba99cd1efde98280700469f6392f7341fce3eb3/src/test/java/wstxtest/vstream/TestInvalidAttributeValue.java#L21-L56

When the test is adapted for SimpleNsStreamWriter it still works.

But when the test is adapted for RepairingNsStreamWriter it does not work anymore.

The PR with a reproducer follows.

ppalaga commented 5 months ago

RepairingNsStreamWriter perhaps has a general problem with attribute access, because it does not see a required attribute that is set in the input document. This can be reproduced by adapting wstxtest.vstream.TestRelaxNG.testPartialValidationOk() a reproducer PR follows.