in reply to Remove attribute in XML
Firstly, xmlns:foo might look like an attribute, and act like an attribute in some circumstances, but it's not really an attribute. Namespace declarations are treated differently to normal attributes in the DOM and XML Infoset. There isn't a reliable way to delete a namespace declaration from an element if it's being used somewhere in the element's subtree.
Secondly, from your example you appear to be trying to process RDF. Don't try to process RDF with generic XML tools - use a dedicated RDF library such as RDF::Trine. (See also here.)
|
|---|