Returns a Boolean. If true, the schema element object is a reference to a top-level <element>
declaration.
The following example of an XML Schema includes some reference declarations. The VBScript code below the XML Schema retrieves isReference
values from the XML Schema.
The following is an XML Schema with reference declarations.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:myschema:all" xmlns:y="urn:myschema:all"> <xsd:complexType name="CustomerType"> <xsd:sequence> <xsd:element ref="y:Customer"/> </xsd:sequence> </xsd:complexType> <xsd:element name="Customer"/> </xsd:schema>
The following is the VBScript example.
Set oSchemaCache = CreateObject("Msxml2.XMLSchemaCache.5.0") nsTarget="urn:myschema:all" oSchemaCache.add nsTarget, "cx.xml" Set oSchema = oSchemaCache.getSchema(nsTarget) ' Retrieve the reference to the <element> declaration. Set oType = oSchema.types.itemByName("CustomerType") Set oSequence = oType.contentModel Set oElemRef = oSequence.particles.item(0) res = oElemRef.name + " isRef:" & oElemRef.isReference & vbNewLine ' Retrieve the original <element> declaration. Set oElemOrg = oSchema.elements.itemByName(oElemRef.name) res = res + oElemOrg.name + " isRef:" & oElemOrg.isReference & vbNewLine WScript.Echo res
The Echo
command will show the following results.
Customer isRef:True Customer isRef:False
var bolIsReference = oISchemaElement.isReference;
None.
<element>
declaration.bolIsReference = oISchemaElement.isReference
None.
<element>
declaration.HRESULT get_isReference (VARIANT_BOOL* isReference);
<element>
declaration.To view reference information for Visual Basic or C/C++ only, click the Language Filter button in the upper-left corner of the page.
element Element | Declaring Elements
Applies to: ISchemaElement Interface