本文整理匯總了VB.NET中System.Xml.Schema.XmlSchemaDatatype.ParseValue方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET XmlSchemaDatatype.ParseValue方法的具體用法?VB.NET XmlSchemaDatatype.ParseValue怎麽用?VB.NET XmlSchemaDatatype.ParseValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Schema.XmlSchemaDatatype
的用法示例。
在下文中一共展示了XmlSchemaDatatype.ParseValue方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Main
' 導入命名空間
Imports System.Xml
Imports System.Xml.Schema
_
Class XMLSchemaExamples
Public Shared Sub Main()
Dim xtr As New XmlTextReader("example.xsd")
Dim schema As XmlSchema = XmlSchema.Read(xtr, New ValidationEventHandler(AddressOf ValidationCallbackOne))
Dim schemaSet As New XmlSchemaSet()
AddHandler schemaSet.ValidationEventHandler, AddressOf ValidationCallbackOne
schemaSet.Add(schema)
schemaSet.Compile()
Dim compiledSchema As XmlSchema = Nothing
For Each schema1 As XmlSchema In schemaSet.Schemas()
compiledSchema = schema1
Next
Dim schemaObject As XmlSchemaObject
For Each schemaObject In compiledSchema.Items
If schemaObject.GetType() Is GetType(XmlSchemaSimpleType) Then
Dim simpleType As XmlSchemaSimpleType = CType(schemaObject, XmlSchemaSimpleType)
Console.WriteLine("{0} {1}", simpleType.Name, simpleType.Datatype.ValueType)
End If
If schemaObject.GetType() Is GetType(XmlSchemaComplexType) Then
Dim complexType As XmlSchemaComplexType = CType(schemaObject, XmlSchemaComplexType)
Console.WriteLine("{0} {1}", complexType.Name, complexType.Datatype.ValueType)
End If
Next schemaObject
xtr.Close()
End Sub
Public Shared Sub ValidationCallbackOne(ByVal sender As Object, ByVal args As ValidationEventArgs)
Console.WriteLine(args.Message)
End Sub
End Class