XmlNode.OuterXml inserting xmlns attribute

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom S.

    XmlNode.OuterXml inserting xmlns attribute

    ..Net Framework 1.1 Version 1.1.4322 SP1
    WinXP SP2
    MS Dev Environment 2003 Version 7.1.3088 ( Visual Studio 2003 )

    I have an xml document that I only use a portion of. Since the xml document
    is not generated by my company, I have no control over whether or not the
    extra info is in there. I have written a method that pulls out only the
    needed information by looping thru each of the nodes until I find the correct
    one and then assigning a string the following value: "node.outerxml" . This
    works perfectly with one exception: the xmlns that is declared higher up in
    the xml document is placed as an attribute into the top node that I've pulled
    out.

    Example: <root xmlns="somename space"><bottom> ...</bottom></root>
    If I pull out only the outerxml of the element 'bottom', I get the
    following: <bottom xmlns="somename space">...</bottom>.

    Is there a way to stop this from happening? Any help would be greatly
    appreciated. Thanks!!!!!!
Working...