XmlSchemaSimpleTypeUnion Class represents the union element for simple types from XML Schema
Imports System
Imports System.Xml
Imports System.Xml.Schema
Class XMLSchemaExamples
Public Shared Sub Main()
Dim schema As New XmlSchema()
Dim StringOrIntType As New XmlSchemaSimpleType()
StringOrIntType.Name = "StringOrIntType"
schema.Items.Add(StringOrIntType)
Dim union As New XmlSchemaSimpleTypeUnion
StringOrIntType.Content = union
Dim simpleType1 As New XmlSchemaSimpleType
union.BaseTypes.Add(simpleType1)
Dim restriction1 As New XmlSchemaSimpleTypeRestriction()
restriction1.BaseTypeName = New XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")
simpleType1.Content = restriction1
Dim simpleType2 As New XmlSchemaSimpleType()
union.BaseTypes.Add(simpleType2)
Dim restriction2 As New XmlSchemaSimpleTypeRestriction()
restriction2.BaseTypeName = New XmlQualifiedName("int", "http://www.w3.org/2001/XMLSchema")
simpleType2.Content = restriction2
End Sub
End Class
Related examples in the same category