Mega Code Archive

 
Categories / VB.Net / XML
 

XmlSchemaSimpleContent Class represents simpleContent element from XML Schema

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 generalPrice As New XmlSchemaElement()         generalPrice.Name = "generalPrice"         Dim ct As New XmlSchemaComplexType()         Dim simpleContent As New XmlSchemaSimpleContent()         Dim simpleContent_extension As New XmlSchemaSimpleContentExtension()         simpleContent_extension.BaseTypeName = New XmlQualifiedName("decimal", "http://www.w3.org/2001/XMLSchema")         Dim currency As New XmlSchemaAttribute()         currency.Name = "currency"         currency.SchemaTypeName = New XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")         simpleContent_extension.Attributes.Add(currency)         simpleContent.Content = simpleContent_extension         ct.ContentModel = simpleContent         generalPrice.SchemaType = ct         schema.Items.Add(generalPrice)     End Sub 'Main End Class 'XMLSchemaExamples