XmlSchemaInclude Class represents include element from XML Schema
Imports System
Imports System.Collections
Imports System.IO
Imports System.Xml
Imports System.Xml.Xsl
Imports System.Xml.Schema
Public Class ImportIncludeSample
Private Shared Sub ValidationCallBack(ByVal sender As Object, ByVal args As ValidationEventArgs)
If args.Severity = XmlSeverityType.Warning Then
Console.Write("WARNING: ")
Else
If args.Severity = XmlSeverityType.Error Then
Console.Write("ERROR: ")
End If
End If
Console.WriteLine(args.Message)
End Sub 'ValidationCallBack
Public Shared Sub Main()
Dim schema As New XmlSchema()
schema.ElementFormDefault = XmlSchemaForm.Qualified
schema.TargetNamespace = "http://www.w3.org/2001/05/XMLInfoset"
Dim import As New XmlSchemaImport()
import.Namespace = "http://www.example.com/IPO"
schema.Includes.Add(import)
Dim include As New XmlSchemaInclude()
include.SchemaLocation = "example.xsd"
schema.Includes.Add(include)
End Sub
End Class
Related examples in the same category