Show / Hide Table of Contents

Method XmlUtil.LoadDoc


Overload

Loads XML file in a safer way. Uses System.Xml.Linq.XDocument.Load and filesystem.waitIfLocked.

public static XDocument LoadDoc(string file, LoadOptions options = LoadOptions.None)
Parameters
file  (string)

File. Must be full path. Can contain environment variables etc, see pathname.expand. If starts with '<', loads from XML string instead.

options  (LoadOptions)
Returns
XDocument
Exceptions
ArgumentException

Not full path.

Exception

Exceptions of System.Xml.Linq.XDocument.Load.

Remarks

Unlike System.Xml.Linq.XDocument.Load, does not replace \r\n with \n.