Returns an ISchemaItemCollection
object. This collection contains top-level <simpleType>
and <complexType>
declarations of the XML Schema. The ISchemaType.itemType
property determines whether the object is of the type complex or simple.
This VBScript example shows type information being extracted from an XML Schema document.
The following is the XML Schema used in the example.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" finalDefault="restriction"> <xsd:element name="item"> <xsd:complexType> <xsd:sequence> <xsd:element name="productName" type="xsd:string"/> <xsd:element name="quantity"> <xsd:simpleType> <xsd:restriction base="xsd:positiveInteger"> <xsd:maxExclusive value="100"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name="USPrice" type="xsd:decimal"/> <xsd:element name="shipDate" type="xsd:date" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="partNum" type="xsd:int" use="required"/> </xsd:complexType> </xsd:element> </xsd:schema>
The following is the VBScript example.
Dim oSchemaCache as New XMLSchemaCache50 Dim oSchema as ISchema Dim oType as ISchemaType Dim nsTarget as String Dim strText as String nsTarget = "http://www.w3.org/2000/09/xmldsig#" oSchemaCache.add nsTarget, "po.xsd" Set oSchema = oSchemaCache.getSchema(nsTarget) For Each oType in oSchema.types strText = oType.name & " is a " If oType.itemType = SOMITEM_ANYTYPE Then strText = strText & "built-in complex any type" End If If oType.itemType = SOMITEM_SIMPLETYPE Then strText = strText & "simple type" End If If oType.itemType = SOMITEM_COMPLEXTYPE Then strText = strText & "complex type" End If If (oType.itemType and SOMITEM_DATATYPE) = SOMITEM_DATATYPE Then strText = strText & "built-in type" End If Next msgbox strText
var oTypes = oISchema.types;
None.
ISchemaType
interface and the ISchemaComplexType
interface.Set oTypes = oISchema.types
None.
ISchemaType
interface and the ISchemaComplexType
interface.HRESULT get_types (ISchemaItemCollection** types);
ISchemaType
interface or the ISchemaComplexType
interface. Use ISchemaType::isComplexType
to query for the correct interface.types
object is Null.To view reference information for Visual Basic or C/C++ only, click the Language Filter button in the upper-left corner of the page.
ISchemaItemCollection Interface | ISchemaType Interface | ISchemaComplexType Interface | ISchemaItem itemType Property
Applies to: ISchema Interface