oozcitak / xmlbuilder-js

An XML builder for node.js
MIT License
918 stars 107 forks source link

Can't remove attribute heired from root #222

Closed OctavioMaia closed 5 years ago

OctavioMaia commented 5 years ago

I'm building a SAML Request using xmlbuilder and it has helped me a lot so far. Sadly there's a bug I can't seem to fix no matter what I try.

This is the function I created to generate the XML, (link) and this the resulting XML (link).

On the "Extensions" tag I don't have any attributes, but it's heiring the "xmlns":"urn:oasis:names:tc:SAML:2.0:protocol" from the root. Can anyone help me fix this? I can't have that attribute there

oozcitak commented 5 years ago

I added a test case, but I can't see an xmlns attribute on the Extensions element. Can you please confirm that the sample code you sent is the actual code you use?

OctavioMaia commented 5 years ago

I added a test case, but I can't see an xmlns attribute on the Extensions element. Can you please confirm that the sample code you sent is the actual code you use?

This is the whole file https://pastebin.com/raw/wpCGS2ZS I'm calling stripExtension() to remove the xmlns attribute from the Extensions element.

oozcitak commented 5 years ago

It appears to be inserted by xml-crypto.

OctavioMaia commented 5 years ago

It appears to be inserted by xml-crypto.

Thank you, I'll have to manually remove it then.

oozcitak commented 5 years ago

NP. You can raise the issue to xml-crypto or maybe xmldom. since this is the package used by xml-crypto to parse and serialize the XMLdocument.