Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

How Do I...? Common Tasks QuickStart Tutorial

How Do I...Infer an XML Schema?

This sample illustrates how to infer an XML schema from a given XML document using the XmlSchemaInference class. An XmlSchemaInference object is used to infer an XML schema from a given XML document, and adds the inferred schema to an XmlSchemaSet object. The inferred schema is further refined using schemas inferred from additional XML documents.

VB XmlSchemaInference.exe
View Source
[This sample can be found at C:\DevFusion.Data\legacy\quickstart.developerfusion.co.uk\QuickStart\howto\samples\Xml\XmlSchemaInference\]

The following code creates the XmlSchemaInference and XmlSchemaSet objects.

XmlSchemaInference infer = new XmlSchemaInference();
XmlSchemaSet sc = new XmlSchemaSet();

The following code infers an XML schema from an XML document.

sc = infer.InferSchema(new XmlTextReader("sample.xml"));

Microsoft .NET Framework SDK QuickStart Tutorials Version 2.0
Copyright � 2004 Microsoft Corporation. All rights reserved.