Class Xml
Allows in/out operations and/or data validations with XML files.
Inherited Members
Namespace: AutoCheck.Core.Connectors
Assembly: AutoCheck.Core.dll
Syntax
public class Xml : Base
Constructors
| Improve this Doc View SourceXml(Utils.OS, String, String, String, Int32, String, ValidationType)
Declaration
public Xml(Utils.OS remoteOS, string host, string username, string password, int port, string filePath, ValidationType validation = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Utils.OS | remoteOS | |
| System.String | host | |
| System.String | username | |
| System.String | password | |
| System.Int32 | port | |
| System.String | filePath | |
| ValidationType | validation |
Xml(Utils.OS, String, String, String, String, ValidationType)
Declaration
public Xml(Utils.OS remoteOS, string host, string username, string password, string filePath, ValidationType validation = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Utils.OS | remoteOS | |
| System.String | host | |
| System.String | username | |
| System.String | password | |
| System.String | filePath | |
| ValidationType | validation |
Xml(String, ValidationType)
Creates a new connector instance.
Declaration
public Xml(string filePath, ValidationType validation = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | XML file path. |
| ValidationType | validation | Validation type. |
Properties
| Improve this Doc View SourceComments
Declaration
public string[] Comments { get; }
Property Value
| Type | Description |
|---|---|
| System.String[] |
Raw
The original XML file content (unparsed).
Declaration
public string Raw { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
XmlDoc
The XML document content.
Declaration
public XmlDocument XmlDoc { get; }
Property Value
| Type | Description |
|---|---|
| XmlDocument |
Methods
| Improve this Doc View SourceCountNodes(String, Xml.XmlNodeType)
Requests for the amount of nodes.
Declaration
public int CountNodes(string xpath, Xml.XmlNodeType type = Xml.XmlNodeType.ALL)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | xpath | XPath expression. |
| Xml.XmlNodeType | type |
Returns
| Type | Description |
|---|---|
| System.Int32 | The amount of nodes. |
CountNodes(XmlNode, String, Xml.XmlNodeType)
Requests for the amount of nodes.
Declaration
public int CountNodes(XmlNode root, string xpath, Xml.XmlNodeType type = Xml.XmlNodeType.ALL)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | root | Root node from where the XPath expression will be evaluated. |
| System.String | xpath | XPath expression. |
| Xml.XmlNodeType | type |
Returns
| Type | Description |
|---|---|
| System.Int32 | The amount of nodes. |
Dispose()
Disposes the object releasing its unmanaged properties.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceEquals(Xml, Boolean)
Declaration
public bool Equals(Xml xmlConn, bool ignoreSchema = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Xml | xmlConn | |
| System.Boolean | ignoreSchema |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Equals(XmlDocument, Boolean)
Declaration
public bool Equals(XmlDocument xmlDoc, bool ignoreSchema = true)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlDocument | xmlDoc | |
| System.Boolean | ignoreSchema |
Returns
| Type | Description |
|---|---|
| System.Boolean |
SelectNodes(String, Xml.XmlNodeType)
Requests for a set of nodes.
Declaration
public List<XPathNavigator> SelectNodes(string xpath, Xml.XmlNodeType type = Xml.XmlNodeType.ALL)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | xpath | XPath expression. |
| Xml.XmlNodeType | type |
Returns
| Type | Description |
|---|---|
| List<XPathNavigator> | A list of nodes. |
SelectNodes(XmlNode, String, Xml.XmlNodeType)
Requests for a set of nodes.
Declaration
public List<XPathNavigator> SelectNodes(XmlNode root, string xpath, Xml.XmlNodeType type = Xml.XmlNodeType.ALL)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | root | Root node from where the XPath expression will be evaluated. |
| System.String | xpath | XPath expression. |
| Xml.XmlNodeType | type |
Returns
| Type | Description |
|---|---|
| List<XPathNavigator> | A list of nodes. |
Extension Methods
ObjectExtensions.DeepClone<T>(T)