martes, 25 de septiembre de 2018

Sacar xmlns

Public Function cleanXmlns(ByVal str As String) As String
        Dim root As XElement = XElement.Parse(str)
        root.DescendantsAndSelf.Attributes.Where(Function(x) x.IsNamespaceDeclaration).Remove()
        For Each el As XElement In root.DescendantsAndSelf()
            el.Name = el.Name.LocalName
        Next
        Return root.ToString
    End Function

No hay comentarios.:

Publicar un comentario