XmlNode.OuterXml inserting xmlns attribute

Tech-Archive recommends: Fix windows errors by optimizing your registry



..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="somenamespace"><bottom>...</bottom></root>
If I pull out only the outerxml of the element 'bottom', I get the
following: <bottom xmlns="somenamespace">...</bottom>.

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



Relevant Pages

  • Re: Visual Studio SP6
    ... looks first for an XML manifest file before transferring control to ... don't know how a simple XML document gets read and changes ... > when I loaded it up and clicked on the Make tab in Project ...
    (microsoft.public.vb.general.discussion)
  • Re: Visual Studio SP6
    ... Thanks, Jim! ... > looks first for an XML manifest file before transferring control to ... > don't know how a simple XML document gets read and changes ... > the way an executable image runs. ...
    (microsoft.public.vb.general.discussion)
  • HELP: Mixing XSLT within a Custom Composite Web Control
    ... I compose an XML string that specifies the "meat" of the control, the data, ... candy resides in the .xslt file. ... Prepare an XML document that has the actual data in a structured fashion. ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: Element content is incomplete (biztalk editor document validat
    ... can you open your xml document using Internet Explorer? ... >>i am trying to validate an xml document using the biztalk 2002 editor. ... >> i am not sure how to tell exactly what portion of the document is in error ... >> what are good techniques to debug this error message ...
    (microsoft.public.biztalk.general)
  • Re: XML control
    ... Internet explorer is one control that displays it hierarchically, ... > XML document in a proper way in my vb .net application. ...
    (microsoft.public.dotnet.general)