Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aalto writes too many xmlns attributes if IS_REPAIRING_NAMESPACES=true #56

Open
UnasZole opened this issue Jan 8, 2018 · 1 comment
Labels
test-needed Issue waiting for reproduction, ideally as stand-alone unit test

Comments

@UnasZole
Copy link

UnasZole commented Jan 8, 2018

Consider the following setup.

  • 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.

@UnasZole 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
@cowtowncoder
Copy link
Member

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.

@cowtowncoder cowtowncoder added active Issue being actively worked on test-needed Issue waiting for reproduction, ideally as stand-alone unit test and removed active Issue being actively worked on labels Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-needed Issue waiting for reproduction, ideally as stand-alone unit test
Projects
None yet
Development

No branches or pull requests

2 participants