Class ExtXml
Adds extension methods for System.Xml.Linq.XElement and System.Xml.Linq.XDocument.
public static class ExtXml
Namespace: Au.Types
Assembly: Au.dll
Methods
Name | Description |
---|---|
Attr(XElement, out double, XName) | Gets attribute value converted to double number.
If the attribute does not exist, sets value = 0 and returns |
Attr(XElement, out int, XName) | Gets attribute value converted to int number.
If the attribute does not exist, sets value = 0 and returns |
Attr(XElement, out long, XName) | Gets attribute value converted to long number.
If the attribute does not exist, sets value = 0 and returns |
Attr(XElement, out float, XName) | Gets attribute value converted to float number.
If the attribute does not exist, sets value = 0 and returns |
Attr(XElement, out string, XName) | Gets XML attribute value.
If the attribute does not exist, sets value = |
Attr(XElement, XName) | Gets XML attribute value.
If the attribute does not exist, returns |
Attr(XElement, XName, int) | Gets attribute value converted to int number. If the attribute does not exist, returns defaultValue. If the attribute value is empty or does not begin with a valid number, returns 0. |
Attr(XElement, XName, string) | Gets XML attribute value.
If the attribute does not exist, returns defaultValue.
If the attribute value is empty, returns |
Attr<T>(XElement, out T, XName) | Gets attribute value as enum type T.
If the attribute does not exist, sets value = |
Desc(XElement, XName) | Gets the first found descendant element. |
Desc(XElement, XName, XName, string, bool) | Finds the first descendant element that has the specified attribute or value. |
Descs(XElement, XName, XName, string, bool) | Finds all descendant elements that have the specified attribute or value. |
Elem(XElement, XName, XName, string, bool) | Gets the first found direct child element that has the specified attribute or value. |
ElemOrAdd(XElement, XName) | Gets the first found direct child element. If not found, adds new empty child element. |
ElemOrAdd(XElement, XName, XName, string, bool) | Gets the first found direct child element that has the specified attribute. If not found, adds new child element with the attribute. More info: ExtXml.Elem |
Elems(XElement, XName, XName, string, bool) | Gets all direct child elements that have the specified attribute or value. |
HasAttr(XElement, XName) | Returns |
NextElem(XElement) | Returns next sibling element or |
PrevElem(XElement) | Returns previous sibling element or |
SaveDoc(XDocument, string, bool, SaveOptions?) | Saves XML to a file in a safer way. Uses System.Xml.Linq.XDocument.Save and filesystem.save |
SaveElem(XElement, string, bool, SaveOptions?) | Saves XML to a file in a safer way. Uses System.Xml.Linq.XElement.Save and filesystem.save. |