You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instantiate an XMLEventReader reading from an xml file, which root element defines an "xmlns" attribute, and contains unprefixed tags. (As an example, you can fetch the W3C's xmldsig schema )
Instantiate an XMLEventWriter writing on another file, with IS_REPAIRING_NAMESPACES=true.
For each event read from the Reader, write it through directly to the Writer.
If aalto-xml 1.0.0 is used as STAX backend, the resulting document's root schema tag's xmlns attribute will be written 3 times, as follows : <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.w3.org/2000/09/xmldsig#" version="0.1" elementFormDefault="qualified">
Note that if I simply switch the implementation to woodstox-core 5.0.3, everything works fine, so this is definitely an issue with aalto-xml.
Also note that definitions of prefixed namespaces (like xmlns:xx) are unaffected by the issue : only the "xmlns" attribute is affected.
The text was updated successfully, but these errors were encountered:
UnasZole
changed the title
Aalto writes too many xmlns attributes IS_REPAIRING_NAMESPACES
Aalto writes too many xmlns attributes if IS_REPAIRING_NAMESPACES=true
Jan 8, 2018
It would be great to have a small reproduction doing what is suggested; no files are needed (input string via Reader should work fine, for example). I trust there is a problem.
Consider the following setup.
If aalto-xml 1.0.0 is used as STAX backend, the resulting document's root schema tag's xmlns attribute will be written 3 times, as follows :
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.w3.org/2000/09/xmldsig#" version="0.1" elementFormDefault="qualified">
Note that if I simply switch the implementation to woodstox-core 5.0.3, everything works fine, so this is definitely an issue with aalto-xml.
Also note that definitions of prefixed namespaces (like xmlns:xx) are unaffected by the issue : only the "xmlns" attribute is affected.
The text was updated successfully, but these errors were encountered: