XmlSchemaInfo Class
Represents the post-schema-validation infoset of a validated XML node.
Assembly: System.Xml (in System.Xml.dll)
| Name | Description | |
|---|---|---|
![]() | XmlSchemaInfo() | Initializes a new instance of the XmlSchemaInfo class. |
| Name | Description | |
|---|---|---|
![]() | ContentType | Gets or sets the XmlSchemaContentType object that corresponds to the content type of this validated XML node. |
![]() | IsDefault | Gets or sets a value indicating if this validated XML node was set as the result of a default being applied during XML Schema Definition Language (XSD) schema validation. |
![]() | IsNil | Gets or sets a value indicating if the value for this validated XML node is nil. |
![]() | MemberType | Gets or sets the dynamic schema type for this validated XML node. |
![]() | SchemaAttribute | Gets or sets the compiled XmlSchemaAttribute object that corresponds to this validated XML node. |
![]() | SchemaElement | Gets or sets the compiled XmlSchemaElement object that corresponds to this validated XML node. |
![]() | SchemaType | Gets or sets the static XML Schema Definition Language (XSD) schema type of this validated XML node. |
![]() | Validity | Gets or sets the XmlSchemaValidity value of this validated XML node. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
The following example validates the contosoBooks.xml file against the contosoBooks.xsd schema. The example uses the XmlSerializer class to deserialize the contosoBooks.xml file and pass the value of the nodes to the methods of the XmlSchemaValidator class.
The example takes the contosoBooks.xml file as input.
<?xml version="1.0" encoding="utf-8" ?> <bookstore xmlns="http://www.contoso.com/books"> <book genre="autobiography" publicationdate="1981-03-22" ISBN="1-861003-11-0"> <title>The Autobiography of Benjamin Franklin</title> <author> <first-name>Benjamin</first-name> <last-name>Franklin</last-name> </author> <price>8.99</price> </book> <book genre="novel" publicationdate="1967-11-17" ISBN="0-201-63361-2"> <title>The Confidence Man</title> <author> <first-name>Herman</first-name> <last-name>Melville</last-name> </author> <price>11.99</price> </book> <book genre="philosophy" publicationdate="1991-02-15" ISBN="1-861001-57-6"> <title>The Gorgias</title> <author> <name>Plato</name> </author> <price>9.99</price> </book> </bookstore>
The example also takes the contosoBooks.xsd as an input.
<?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.contoso.com/books" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="bookstore"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="book"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string" /> <xs:element name="author"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="name" type="xs:string" /> <xs:element minOccurs="0" name="first-name" type="xs:string" /> <xs:element minOccurs="0" name="last-name" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="price" type="xs:decimal" /> </xs:sequence> <xs:attribute name="genre" type="xs:string" use="required" /> <xs:attribute name="publicationdate" type="xs:date" use="required" /> <xs:attribute name="ISBN" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


