IbrarMumtaz
IbrarMumtaz

Reputation: 4393

Can an XMLDocument object be use with an XPathDocument object?

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.

Upvotes: 1

Views: 1729

Answers (1)

user203570
user203570

Reputation:

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.

Upvotes: 1

Related Questions