* wrote in comp.text.xml:
>In my C# program I execute an attributes remove to remove all
>attributes in the following root node.
>All attributes are removed EXCEPT
>What am I doing wrong or is there a workaround?
The "xmlns" attribute (as well as xmlns:* attributes) are special
attributes that declare the default namespace and namespace pre-
fixes. In the example above you have an element 'xtvd' in the
'urn:TMSWebServices' namespace, if you remove the xmlns "attribute"
you would essentially rename the element, so that's what you would
have to do in order to get rid of them. That's typically not very
useful though, applications would no longer recognize the elements
in the document.
Björn Höhrmann · private.php?do=newpm&u= · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
I understand what you are saying.
The odd thing is that when I leave any attributes in the root node, I
cannot read any of the elements or attributes in the XML file using
XPathNavigator/XPathNodeIterator. When I manually remove everything in
the root node except the name <xtvd> everything works just fine.
I am using C# with Visual Studio 2003. Maybe there's something quirky
I cannot find a rename method. Is there some other way I can work
around this problem?
* Sam Stamport wrote in comp.text.xml:
>I understand what you are saying.
>The odd thing is that when I leave any attributes in the root node, I
>cannot read any of the elements or attributes in the XML file using
>XPathNavigator/XPathNodeIterator. When I manually remove everything in
>the root node except the name <xtvd> everything works just fine.
You need to use an XmlNamespaceManager here, declare a prefix for the
xmlns="urn:TMSWebServices" namespace and use namespace prefixes in the
XPath expressions, so instead of "/xtvd" you would use "/prefixtvd".