Skip to content

Unable to remove all namespaces #6

@mingfang

Description

@mingfang

I'm using this parser to parse a SAML AuthResponse am unable to remove all the namespaces.
Here is a short script to demonstrate the problem.

local xml = require("xml")

local data = xml.load [[
<samlp:Response ID='_cefdb557d60e0ba08b37' IssueInstant='2015-09-02T05:45:46Z' Destination='http://rebelsoft.com:81/saml/acs' xmlns:samlp='urn:oasis:names:tc:SAML:2.0:protocol' Version='2.0'>
  <saml:Issuer xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion'>http://rebelsoft.com:81</saml:Issuer>
</samlp:Response>
]]

xml.removeNamespace(data, 'urn:oasis:names:tc:SAML:2.0:protocol')
xml.removeNamespace(data, 'urn:oasis:names:tc:SAML:2.0:assertion')

print(xml.dump(data))

In this demo, the first removeNamespace() works, but not the second one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions