shlomif / perl-XML-LibXML

The XML-LibXML CPAN Distribution for Processing XML using the libxml2 library
https://metacpan.org/release/XML-LibXML
Other
17 stars 35 forks source link

Namespace declaration gets removed when using replaceNode #78

Open waterkip opened 1 year ago

waterkip commented 1 year ago

The following test case fails (see attached file).

We have a node that has the string representation of:

<saml:Assertion xmlns="foobar" xmlns:saml="foobar" ID="ID_af2d76cb-6e6b-4ad0-a1a0-ea85ee839dbc" IssueInstant="2022-03-27T12:06:56.740Z" Version="2.0">Some assertion data</saml:Assertion>

This gets changed when using replaceNode() to:

<saml:Assertion xmlns="foobar" ID="ID_af2d76cb-6e6b-4ad0-a1a0-ea85ee839dbc" IssueInstant="2022-03-27T12:06:56.740Z" Version="2.0">Some assertion data</saml:Assertion>

This causes some namespacing issues in our code because the namespace has been removed.

replace-node-bug.t.txt