Class SimpleParser
This class uses the validating System.Xml.XmlReader to load XML into System.Xml.XmlDocument which is then converted to IXmlDocument.
Inherited Members
Namespace: Tangosol.Run.Xml
Assembly: Coherence.dll
Syntax
public class SimpleParser
Methods
CreateReaderSettings(XmlSchemaSet, ValidationEventHandler)
Gets an XmlReaderSettings with specified schemas used for validation and validation event handler.
Declaration
protected virtual XmlReaderSettings CreateReaderSettings(XmlSchemaSet schemas, ValidationEventHandler eventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlSchemaSet | schemas | XML schemas that will be used for validation. |
| ValidationEventHandler | eventHandler | Validation event handler. |
Returns
| Type | Description |
|---|---|
| XmlReaderSettings | XmlReaderSettings instance. |
CreateValidatingReader(Stream, XmlSchemaSet, ValidationEventHandler)
Declaration
protected virtual XmlReader CreateValidatingReader(Stream stream, XmlSchemaSet schemas, ValidationEventHandler eventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The XML Stream. |
| XmlSchemaSet | schemas | XML schemas that will be used for validation. |
| ValidationEventHandler | eventHandler | Validation event handler. |
Returns
| Type | Description |
|---|---|
| XmlReader | XmlReader implementation. |
CreateValidatingReader(TextReader, XmlSchemaSet, ValidationEventHandler)
Gets an XmlReader instance for the supplied TextReader.
Declaration
protected virtual XmlReader CreateValidatingReader(TextReader textReader, XmlSchemaSet schemas, ValidationEventHandler eventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| TextReader | textReader | The XML TextReader. |
| XmlSchemaSet | schemas | XML schemas that will be used for validation. |
| ValidationEventHandler | eventHandler | Validation event handler. |
Returns
| Type | Description |
|---|---|
| XmlReader | XmlReader implementation. |
LoadXml(TextReader)
Gets the XmlDocument representing data from a given TextReader.
Declaration
protected virtual XmlDocument LoadXml(TextReader textReader)
Parameters
| Type | Name | Description |
|---|---|---|
| TextReader | textReader | TextReader that will provide Xml data. |
Returns
| Type | Description |
|---|---|
| XmlDocument | XmlDocument representing Xml data. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If |
| XmlException | If there is a load or parse error in the XML. |
LoadXml(IResource)
Gets the XmlDocument representing data from a given resource.
Declaration
protected virtual XmlDocument LoadXml(IResource resource)
Parameters
| Type | Name | Description |
|---|---|---|
| IResource | resource | IResource with Xml data. |
Returns
| Type | Description |
|---|---|
| XmlDocument | XmlDocument representing Xml data. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If |
| XmlException | If there is a load or parse error in the XML. |
ParseXml(Stream)
Parse the specified Stream into an IXmlDocument object.
Declaration
public virtual IXmlDocument ParseXml(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The Stream object. |
Returns
| Type | Description |
|---|---|
| IXmlDocument | An IXmlDocument object. |
ParseXml(Stream, Encoding)
Parse the specified Stream into an IXmlDocument object using the specified charset.
Declaration
public virtual IXmlDocument ParseXml(Stream stream, Encoding encoding)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The Stream object. |
| Encoding | encoding | The character encoding. |
Returns
| Type | Description |
|---|---|
| IXmlDocument | An IXmlDocument object. |
Exceptions
| Type | Condition |
|---|---|
| IOException |
ParseXml(TextReader)
Parse the specified TextReader into an IXmlDocument object.
Declaration
public virtual IXmlDocument ParseXml(TextReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| TextReader | reader | The TextReader object. |
Returns
| Type | Description |
|---|---|
| IXmlDocument | An IXmlDocument object. |
ParseXml(string)
Parse the resource specified by path into an IXmlDocument object.
Declaration
public virtual IXmlDocument ParseXml(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Location of Xml data; an URL or valid path. |
Returns
| Type | Description |
|---|---|
| IXmlDocument | An IXmlDocument object. |
ParseXml(IResource)
Parse the specified resource's content into an IXmlDocument object.
Declaration
public virtual IXmlDocument ParseXml(IResource resource)
Parameters
| Type | Name | Description |
|---|---|---|
| IResource | resource | The IResource with XML to parse. |
Returns
| Type | Description |
|---|---|
| IXmlDocument | An IXmlDocument object. |