views:

28

answers:

1

I have a static method that converts a html file and returns an XMLDocument object.

After doing extensive research, the following question has arised:

Can pass an XMLDocument object to a XPathDocument object, to make it easy when simply reading data from the document and not editing it.

Research01

MSDN

Please reply and let me know if this is possible? If so, how?

Cheers.

A: 

How are you reading data from the document? Both XmlDocument and XPathDocument have a CreateNavigator method that returns an XPathNavigator for reading the document. Otherwise, just stream the XmlDocument into a MemoryStream and create the XPathDocument from that.

Matthew Ferreira
Cheers dude ... I am using SGMLReader to produce my XML document. WHenever I feed this into a XPathDocument I get one root object with all the html passed into the inner text, which is useless for me :(
IbrarMumtaz