[YANGTOOLS-926] XMLStreamNormalizedNodeStreamWriter anyxml breaks with woodstox Created: 15/Jan/19  Updated: 16/Jan/19  Resolved: 16/Jan/19

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: 2.1.7
Fix Version/s: 2.1.8

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks NETCONF-591 Netconf connection failing in master ... Resolved
Relates
relates to YANGTOOLS-801 New XML serializer does not emit name... Resolved

 Description   

As noted in NETCONF-591 if we have a slightly different XMLOutputFactory in the picture anyxml serialization fails.

This can be readily observed by dropping woodstox-core as a test dependency in yang-data-codec-xml - it will escalate multiple errors, some of which are showing NETCONF-591 breakage with others being comparison errors.

The most notable issue is anyxml encoding, which seems to be hacky at best and could probably be fixed by not using a transformer.



 Comments   
Comment by Robert Varga [ 15/Jan/19 ]

So the hackiness of anyxml encoding comes from the fact we are using a Transformer to stream events from DOMSource to XMLStreamWriter and that implementation is definitely buggy – hence we should just ditch the transformer and never look back.

Doing that requires some thought as to what we want to do, the options being:

  1. use DOMSourceXMLStreamReader (based on stax2-api) and pipe that into the writer
  2. write a Element -> XMLStreamWriter transcriber
  3. try to retain Transformer by attepting a DOM -> SAX -> StAX conversion with an intermediate XMLEventWriter
  4. something completely different

 

Comment by Robert Varga [ 16/Jan/19 ]

Option 1 is the simplest and seems to work okay.

Generated at Wed Feb 07 20:54:42 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.