Show / Hide Table of Contents

Method XmlUtil.LoadElem


Overload

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

public static XElement LoadElem(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
XElement
Exceptions
ArgumentException

Not full path.

Exception

Exceptions of System.Xml.Linq.XElement.Load.

Remarks

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