I’m working with XDocument at the moment and trying to find a property for where the document was originally loaded from:
For example, this will load a file located at url:
XDocument doc = XDocument.Load(url);
To save, I would need to do:
XDocument.Save(url)
I may need to to pass doc to another method in another class and have it save back to that location without passing the url along.
Is the ‘url’ value stored anywhere within the doc object?
Use the
XObject.BaseUriproperty.But not to have it set to
null, you have to load your document withLoadOptions.SetBaseUriset: