System.Xml.Linq
4.0.0.0
System.Object
This class also contains methods to get the post-schema-validation infoset (PSVI) of a validated XML node.
When you validate an , , or , you can also optionally populate the XML tree with the post-schema-validation infoset. PSVI information is added as an annotation of type .
This class contains the sqltecxlinq extension methods for XSD validation.
Method
4.0.0.0
System.Xml.Schema.IXmlSchemaInfo
You can use the returned by this method to determine certain characteristics of a validated attribute. For example, you can determine if the attribute came from a default attribute value in an XSD.
You use the property to get a partial validation type (). You can use it to revalidate an attribute without validating an entire document.
For an example of this property, see .
Gets the post-schema-validation infoset (PSVI) of a validated attribute.
A that contains the post-schema-validation infoset for an .
An that has been previously validated.
Method
4.0.0.0
System.Xml.Schema.IXmlSchemaInfo
You can use the returned by this method to determine certain characteristics of a validated element. For example, you can determine the dynamic schema type of the element.
You use the property to get a partial validation type (). You can use it to revalidate a sub-tree with an element at its root without validating an entire document.
For an example of this property, see .
Gets the post-schema-validation infoset (PSVI) of a validated element.
A that contains the post-schema-validation infoset (PSVI) for an .
An that has been previously validated.
Method
4.0.0.0
System.Void
This extension method validates that the conforms to the schema content model in .
This method validates that an conforms to an XSD in an .
The to validate.
An to validate against.
A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors.
Method
4.0.0.0
System.Void
You can use this method to validate that an conforms to a schema. You typically use this method when you have modified an attribute, and you want to make sure that it still conforms to its schema. You could validate the entire document, but it takes less processing time to validate just the attribute.
If you pass null for , this method raises an exception upon validation errors. Validation warnings will not raise an exception.
To validate an attribute, you use an instance of . You can obtain this instance in various ways. An easy way is as follows:
-
Validate that a document conforms to a schema.
-
Add the post-schema-validation infoset (PSVI) by calling the extension method.
-
Call the extension method to retrieve an object that implements . From the retrieved object, you can get an .
-
If you get an for an , the type will be .
-
If you get an for an , the type will be .
After you have an instance of an , you can use this method to validate an attribute.
This method validates that an conforms to a specified and an .
The to validate.
An that specifies the sub-tree to validate.
An to validate against.
A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors.
Method
4.0.0.0
System.Void
This extension method validates that the conforms to the schema content model in .
If is true, this method populates the XML tree with the post-schema-validation infoset (PSVI).
There are two steps to populating the XML tree with the PSVI.
-
First, an annotation is added to all nodes in the tree to enable you to call or on an element or attribute in the tree.
-
Second, default elements and attributes defined in the XSD are added to the XML tree. By calling one of the methods, you can determine if a specific element or attribute was added from the XSD as a default element or attribute.
Validates that an conforms to an XSD in an , optionally populating the XML tree with the post-schema-validation infoset (PSVI).
The to validate.
An to validate against.
A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors.
A indicating whether to populate the post-schema-validation infoset (PSVI).
Method
4.0.0.0
System.Void
You can use this method to validate that a sub-tree (with an at its root) conforms to a schema. You typically use this method when you have modified a sub-tree, and you want to make sure that it still conforms to its schema. You could validate the entire document, but it takes less processing time to validate a just a sub-tree.
If you pass null for , then this method raises an exception upon validation errors. Validation warnings will not raise an exception.
To validate a sub-tree, you use an instance of . You can obtain this instance in various ways. An easy way is as follows:
-
Validate that a document conforms to a schema.
-
Add the post-schema-validation infoset (PSVI) by calling the extension method.
-
Call the extension method to retrieve an object that implements . From the retrieved object, you can get an .
-
If you get an for an , the type will be .
-
If you get an for an , the type will be .
After you have an instance of an , you can use this method to validate an sub-tree.
This method validates that an sub-tree conforms to a specified and an .
The to validate.
An that specifies the sub-tree to validate.
An to validate against.
A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors.
Method
4.0.0.0
System.Void
You can use this method to validate that an conforms to a schema. You typically use this method when you have modified an attribute, and you want to make sure that it still conforms to its schema. You could validate the entire document, but it takes less processing time to validate just the attribute.
If is true, this method populates the attribute with the post-schema-validation infoset (PSVI). After you have populated the XML tree with the PSVI, you can call on the validated attribute. This is useful if you are writing code that relies on data returned by .
If you pass null for , then this method raises an exception upon validation errors. Validation warnings will not raise an exception.
To validate an attribute, you use an instance of . You can obtain this instance in various ways. An easy way is as follows:
-
Validate that a document conforms to a schema.
-
Add the post-schema-validation infoset (PSVI) by calling the extension method.
-
Call the extension method to retrieve an object that implements . From the retrieved object, you can get an .
-
If you get an for an , the type will be .
-
If you get an for an , the type will be .
After you have an instance of an , you can use this method to validate an attribute.
Validates that an conforms to a specified and an , optionally populating the XML tree with the post-schema-validation infoset (PSVI).
The to validate.
An that specifies the sub-tree to validate.
An to validate against.
A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors.
A indicating whether to populate the post-schema-validation infoset (PSVI).
Method
4.0.0.0
System.Void
You can use this method to validate that a sub-tree (with an at the root of the sub-tree) conforms to a schema. You typically use this method when you have modified a sub-tree, and you want to make sure that it still conforms to its schema. You could validate the entire document, but it takes less processing time to validate a just a sub-tree.
If is true, then this method populates the XML tree with the post-schema-validation infoset (PSVI).
There are two aspects of populating the XML tree with the PSVI.
First, an annotation is added to all nodes in the tree such that you can now call on an element or attribute in the tree.
Second, default elements and attributes defined in the XSD are added to the XML tree. By calling one of the methods, you can determine if a specific element or attribute was added from the XSD as a default element or attribute.
If you pass null for , then this method raises an exception upon validation errors. Validation warnings will not raise an exception.
To validate a sub-tree, you use an instance of . You can obtain this instance in various ways. An easy way is as follows:
-
Validate that a document conforms to a schema.
-
Add the post-schema-validation infoset (PSVI) by calling the extension method.
-
Call the extension method to retrieve an object that implements . From the retrieved object, you can get an .
-
If you get an for an , the type will be .
-
If you get an for an , the type will be .
After you have an instance of an , you can use this method to validate a sub-tree..
Validates that an sub-tree conforms to a specified and an , optionally populating the XML tree with the post-schema-validation infoset (PSVI).
The to validate.
An that specifies the sub-tree to validate.
An to validate against.
A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors.
A indicating whether to populate the post-schema-validation infoset (PSVI).