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
파일 보기 프로젝트 열기: jornfilho/.net-Dev-Utils

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