[ Team LiB ] Previous Section Next Section

14.3 Microsoft.XsdInference Namespace Reference

The Microsoft.XsdInference namespace contains one class, Infer, which can be used to infer an XML Schema Definition from an XML document instance.

InferMicrosoft.XsdInference (xsdinfer.dll)    class 

public class Infer {
// Public Constructors
   public Infer( );  
// Public Instance Methods
   public XmlSchemaCollection InferSchema( System.Xml.XmlReader xmlTR);  
   public XmlSchemaCollection InferSchema( System.Xml.XmlReader xmlTR, System.Xml.Schema.XmlSchemaCollection xsc);  

Infer has a single overloaded method, InferSchema( ), which returns a System.Xml.Schema.XmlSchemaCollection. One overload takes just a System.Xml.XmlReader, and the other one takes a System.Xml.XmlReader and a System.Xml.Schema.XmlSchemaCollection. If the XML document in the System.Xml.XmlReader matches one of the System.Xml.Schema.XmlSchema instances in the System.Xml.Schema.XmlSchemaCollection, the inferred schema is used to refine the matched schema. Repeated calls to InferSchema( ) with different XML documents can thus be used to infer and progressively refine an XML schema.

    [ Team LiB ] Previous Section Next Section