Re: System.XML.XPath XPathDocument load question
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Thu, 17 Aug 2006 16:41:14 +0200
Tony Girgenti wrote:
I'm getting an XML document this way:
Dim node As XmlNode = proxy.RetrieveArchivedTrips(strDate, endDate)
Dim doc As XmlDocument = node.OwnerDocument
doc.AppendChild(node)
At this point "doc" contains the XML document that i am using. However, i'm reading Beginning VB.NET XML. In all of the examples to use XPathDocument, it always refers to a file on disk such as:
Dim xpDoc As XPathDocument = New XPathDocument("..\\CaseStudy.xml")
In the above statement, how do i get my "doc" to be used in place of "..\\CaseStudy.xml" ?
XmlDocument and XPathDocument are two different classes but both implement IXPathNavigable.
So usually all you do with xpDoc is e.g.
Dim navigator As XPathNavigator = xpDoc.CreateNavigator();
where you could simply do
Dim navigator As XPathNavigator = doc.CreateNavigator();
to get an XPathNavigator over your XmlDocument instance. The use of that navigator is the same then, whether you created it from an XPathDocument or XmlDocument instance.
Does that help? Or why exactly do you want/need to have an XPathDocument when you already have an XmlDocument?
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.
- Follow-Ups:
- Re: System.XML.XPath XPathDocument load question
- From: Tony Girgenti
- Re: System.XML.XPath XPathDocument load question
- References:
- System.XML.XPath XPathDocument load question
- From: Tony Girgenti
- System.XML.XPath XPathDocument load question
- Prev by Date: System.XML.XPath XPathDocument load question
- Next by Date: Re: System.XML.XPath XPathDocument load question
- Previous by thread: System.XML.XPath XPathDocument load question
- Next by thread: Re: System.XML.XPath XPathDocument load question
- Index(es):
Relevant Pages
|