Option Explicit On
Option Strict On
Imports System
Imports System.Xml
Imports System.Xml.Schema
Class XMLSchemaExamples
Public Shared Sub Main()
Dim schema As New XmlSchema()
Dim attributeBase As New XmlSchemaAttribute()
schema.Items.Add(attributeBase)
attributeBase.Name = "mybaseattribute"
Dim simpleType As New XmlSchemaSimpleType()
attributeBase.SchemaType = simpleType
Dim restriction As New XmlSchemaSimpleTypeRestriction()
simpleType.Content = restriction
restriction.BaseTypeName = New XmlQualifiedName("integer", "http://www.w3.org/2001/XMLSchema")
Dim maxInclusive As New XmlSchemaMaxInclusiveFacet()
restriction.Facets.Add(maxInclusive)
maxInclusive.Value = "1000"
Dim complexType As New XmlSchemaComplexType()
schema.Items.Add(complexType)
complexType.Name = "myComplexType"
Dim attributeBaseRef As New XmlSchemaAttribute()
complexType.Attributes.Add(attributeBaseRef)
attributeBaseRef.RefName = New XmlQualifiedName("mybaseattribute")
End Sub
End Class