Option Strict On
Option Explicit On
Imports System
Imports System.Xml
Imports System.Xml.Schema
Class XMLSchemaExamples
Public Shared Sub Main()
Dim schema As New XmlSchema()
Dim address As New XmlSchemaComplexType()
schema.Items.Add(address)
address.Name = "address"
Dim sequence As New XmlSchemaSequence()
address.Particle = sequence
Dim elementName As New XmlSchemaElement()
sequence.Items.Add(elementName)
elementName.Name = "name"
elementName.SchemaTypeName = New XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")
Dim USAddress As New XmlSchemaComplexType()
schema.Items.Add(USAddress)
USAddress.Name = "USAddress"
Dim complexContent As New XmlSchemaComplexContent()
USAddress.ContentModel = complexContent
Dim extensionAddress As New XmlSchemaComplexContentExtension()
complexContent.Content = extensionAddress
extensionAddress.BaseTypeName = New XmlQualifiedName("address")
Dim sequence2 As New XmlSchemaSequence()
extensionAddress.Particle = sequence2
Dim elementUSState As New XmlSchemaElement()
sequence2.Items.Add(elementUSState)
elementUSState.Name = "state"
elementUSState.SchemaTypeName = New XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")
End Sub 'Main
End Class