aalto-xml icon indicating copy to clipboard operation
aalto-xml copied to clipboard

Validation implementation of `XMLStreamWriter` incomplete

Open beckchr opened this issue 14 years ago • 3 comments

Validation is not working with an XMLStreamWriter. A quick comparison with woodstox makes obvious that several calls to XMLValidator are missing in StreamWriterBase (at least in writeAttribute(...), writeStartElement(...) and _closeStartElement(...)) and subclasses (several locations).

Furthermore, the invocation of XMLValidator..validateElementEnd(...) in StreamWriterBase._validator.validateElementEnd() mixes up the prefix and nsUri arguments.

beckchr avatar Mar 13 '11 14:03 beckchr

Correct, it has not (yet) been implemented. But it probably should not be lots of work to complete this, less than work to make reader-side validation work.

cowtowncoder avatar Mar 21 '11 16:03 cowtowncoder

Actually only now realized that there is support, just not complete, and obviously not (well) tested. But validator instance is passed; and we can perhaps use Stax2 test suite to help validate validation too...

cowtowncoder avatar Mar 30 '18 22:03 cowtowncoder

After brief look, this is not trivial to add. Doable, certainly, but needs to dig in, compare how Woodstox it does (probably), and do it.

Also worth noting that since Aalto itself does not provide validators, nor Stax2 (although a ref impl might make sense?), users would need to write their own validator or use Woodstox-provided implementation. Tests here can do latter.

cowtowncoder avatar Apr 03 '18 02:04 cowtowncoder