C# Class SimpleSchemaParser.SchemaParser

The SchemaParser can parse a schema into simple element definitions. This class uses System.Xml.Schema.XmlSchemaSet to iterate over all the toplevel element and recursively parses them. The parser doesn't support xml elements occuring in multiple contexts. The first occurence of the element will be output, other occurences will be ignored.
Mostrar archivo Open project: q42jaap/xsd2codemirror Class Usage Examples

Public Methods

Method Description
Compile ( ) : void

Compiles the schema. Includes are assumed to be relative to the schemaPath provided. If they cannot be read, an exception will only be thrown if an element from the included resource is used. A missing file itself is ignored by the XmlSchemaSet class.

GetXmlElements ( ) : IEnumerable
SchemaParser ( string schemaPath ) : System

Private Methods

Method Description
GetParticleDesc ( XmlSchemaParticle particle ) : string
ParseAttribute ( XmlSchemaAttribute attribute ) : SimpleXmlAttribute
ParseElement ( XmlSchemaElement element, bool isTopLevel = false ) : XmlQualifiedName
ParseGoupRef ( XmlSchemaGroupRef groupRef ) : RecursiveChildren

Parses xs:group ref="..." elements in the schema

ParseGroupBase ( XmlSchemaGroupBase group ) : RecursiveChildren

Parses xs:sequence and xs:choice elements in the schema

Method Details

Compile() public method

Compiles the schema. Includes are assumed to be relative to the schemaPath provided. If they cannot be read, an exception will only be thrown if an element from the included resource is used. A missing file itself is ignored by the XmlSchemaSet class.
public Compile ( ) : void
return void

GetXmlElements() public method

public GetXmlElements ( ) : IEnumerable
return IEnumerable

SchemaParser() public method

public SchemaParser ( string schemaPath ) : System
schemaPath string
return System