Connecting Tech Pros Worldwide Forums | Help | Site Map

Convert DOMDocument to System.Xml.Document?

Dean Slindee
Guest
 
Posts: n/a
#1: Nov 12 '05
Newbie question: Any easy way to convert a DOMDocument to a
System.Xml.Document?

Dim DOMDocument As DOMDocument40

to this

Dim xmlDoc As System.Xml.XmlDocument

Thanks,

Dean Slindee



Peter Rilling
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Convert DOMDocument to System.Xml.Document?


The easiest way might be to output the XML from the DOMDocument (I can't
remember which property/method does this) and load it into the LoadXml
method on the XmlDocument object.

"Dean Slindee" <slindee@mindspring.com> wrote in message
news:OdatymRvDHA.3224@tk2msftngp13.phx.gbl...[color=blue]
> Newbie question: Any easy way to convert a DOMDocument to a
> System.Xml.Document?
>
> Dim DOMDocument As DOMDocument40
>
> to this
>
> Dim xmlDoc As System.Xml.XmlDocument
>
> Thanks,
>
> Dean Slindee
>
>[/color]


Martin Honnen
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Convert DOMDocument to System.Xml.Document?




Dean Slindee wrote:
[color=blue]
> Newbie question: Any easy way to convert a DOMDocument to a
> System.Xml.Document?
>
> Dim DOMDocument As DOMDocument40
>
> to this
>
> Dim xmlDoc As System.Xml.XmlDocument[/color]

I don't understand why you need to use two different XML imlementations
in one application (after all the XML format should allow you to use any
parser) but it seems that
xmlDoc.LoadXml(DOMDocument.xml)
should work.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Dean Slindee
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Convert DOMDocument to System.Xml.Document?


Yes, that did the trick. By way of explanation: communicating with eBay is
done thru DOMDocument, but as a .NET developer I would prefer to use
system.xml as much as possible, so I want to convert from DOM up front.
Thanks.
Dean Slindee
"Martin Honnen" <Martin.Honnen@t-online.de> wrote in message
news:eZeejJYvDHA.1764@TK2MSFTNGP10.phx.gbl...[color=blue]
>
>
> Dean Slindee wrote:
>[color=green]
> > Newbie question: Any easy way to convert a DOMDocument to a
> > System.Xml.Document?
> >
> > Dim DOMDocument As DOMDocument40
> >
> > to this
> >
> > Dim xmlDoc As System.Xml.XmlDocument[/color]
>
> I don't understand why you need to use two different XML imlementations
> in one application (after all the XML format should allow you to use any
> parser) but it seems that
> xmlDoc.LoadXml(DOMDocument.xml)
> should work.
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/
>[/color]


Closed Thread