These tutorials demonstrate selected features in ASP.NET version 2.0, but they are compatible with later versions of ASP.NET as well. For the current documentation, see the ASP.NET portal on the MSDN Web site.

 

 

   Welcome   |   ASP.NET   |   Web Services   |   Class Browser   
  |   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 by using the XmlSchemaInference class. An XmlSchemaInference object is used to infer an XML schema from a particular XML document, and then adds the inferred schema to an XmlSchemaSet object. The inferred schema is further refined by using schemas inferred from additional XML documents.

VB XmlSchemaInference.exe
View Source

The following code creates the XmlSchemaInference and XmlSchemaSet objects.

		
Dim infer As New XmlSchemaInference()
Dim sc As New XmlSchemaSet()
VB

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

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



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