William wrote:
> I would like to pass an XmlDocument to a method as a non-referenced
> object. Can this be done?
Hi William,
You'll need to clone it. I believe the XmlDocument object exposes a Clone
method, which you can use to clone it, and so pass it in like this:
SomeClass.SomeMethod( theXmlDoc.Clone() as XmlDocument );
The reason for the 'as' there is that the Clone() method returns an XmlNode,
and (hopefully) will actually return the cloned instance of the
XmlDocument, since XmlDocument inherits from XmlNode.
Hope this helps,
-- Tom Spink
|