C# Класс DevUtils.Xml.XmlUtils

The XmlUtils type provides an implementation of the IXmlUtils interface that provides utility methods for common XML operations.

Base project reference: https://github.com/cjaehnen/OpenLib.Utils

Наследование: IXmlUtils
Показать файл Открыть проект

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
CreateDocument ( string path, string fileName, string xml, string xsd, string ns ) : bool

Create a XML document

GetElement ( string path, string element, System.Xml.Linq.XNamespace ns ) : string

Gets the value of the specified XML element from the specified XML file.

UpdateElement ( string path, string element, string value, System.Xml.Linq.XNamespace ns ) : bool

Updates the specified XML element with a value for the specified XML file.

ValidateDocument ( string xml, string xsd, string ns ) : bool

Validates if the specified XML document conforms to the specified XSD schema containing the specified namespace.

XmlUtils ( ) : System

Creates a new instance of the XmlUtils class.

XmlUtils ( IIoDirectoryUtils ioDirectoryUtils ) : System

Creates a new instance of the XmlUtils class.

XmlUtils ( IIoDirectoryUtils ioDirectoryUtils, IIoFileUtils ioFileUtils ) : System

Creates a new instance of the XmlUtils class.

XmlUtils ( IIoFileUtils ioFileUtils ) : System

Creates a new instance of the XmlUtils class.

Описание методов

CreateDocument() публичный Метод

Create a XML document
public CreateDocument ( string path, string fileName, string xml, string xsd, string ns ) : bool
path string The path to the file.
fileName string The file name.
xml string The XML document as a string to validate.
xsd string The XSD schema as a string used for validation.
ns string The target namespace.
Результат bool

GetElement() публичный Метод

Gets the value of the specified XML element from the specified XML file.
public GetElement ( string path, string element, System.Xml.Linq.XNamespace ns ) : string
path string The path to the file.
element string The name of the XML element.
ns System.Xml.Linq.XNamespace An optional namespace for the XML element. (Set null to ignore)
Результат string

UpdateElement() публичный Метод

Updates the specified XML element with a value for the specified XML file.
public UpdateElement ( string path, string element, string value, System.Xml.Linq.XNamespace ns ) : bool
path string The path to the file.
element string The name of the XML element.
value string The value to update for the XML element.
ns System.Xml.Linq.XNamespace An optional namespace for the XML element. (Set null to ignore)
Результат bool

ValidateDocument() публичный Метод

Validates if the specified XML document conforms to the specified XSD schema containing the specified namespace.
public ValidateDocument ( string xml, string xsd, string ns ) : bool
xml string The XML document as a string to validate.
xsd string The XSD schema as a string used for validation.
ns string The target namespace.
Результат bool

XmlUtils() публичный Метод

Creates a new instance of the XmlUtils class.
public XmlUtils ( ) : System
Результат System

XmlUtils() публичный Метод

Creates a new instance of the XmlUtils class.
public XmlUtils ( IIoDirectoryUtils ioDirectoryUtils ) : System
ioDirectoryUtils IIoDirectoryUtils A reference to the IIoDirectoryUtils for performing I/O directory operations.
Результат System

XmlUtils() публичный Метод

Creates a new instance of the XmlUtils class.
public XmlUtils ( IIoDirectoryUtils ioDirectoryUtils, IIoFileUtils ioFileUtils ) : System
ioDirectoryUtils IIoDirectoryUtils A reference to the IIoDirectoryUtils for performing I/O directory operations.
ioFileUtils IIoFileUtils A reference to the IIoFileUtils for performing I/O file operations.
Результат System

XmlUtils() публичный Метод

Creates a new instance of the XmlUtils class.
public XmlUtils ( IIoFileUtils ioFileUtils ) : System
ioFileUtils IIoFileUtils A reference to the IIoFileUtils for performing I/O file operations.
Результат System