substitutionGroupExclusions Property

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SOM Reference

substitutionGroupExclusions Property

Returns an enumerated value from the SCHEMADERIVATIONMETHOD declarations. The possible values are SCHEMADERIVATIONMETHOD_EXTENSION and SCHEMADERIVATIONMETHOD_RESTRICTION. The returned value is the derived-by type that will cause a substitution group affiliation to fail.

You create a substitution group affiliation by adding the substitutionGroup attribute to an <element> declaration. When the substitutionGroupExclusion attribute is set to "extension" and the affiliated element has been derived by extension, substitution will not work. When the substitutionGroupExclusion attribute is set to "restriction" and the affiliated element has been derived by restriction, substitution will not work. When both "extension" and "restriction" are set as values for the substitutionGroupExclusion attribute, no substitution is allowed for the elements in the affiliation group.

Example

The following example shows an XML Schema document that is not valid because 'eleB' cannot nominate 'eleA' as the head of its substitution group affiliation.

<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
  <xsd:element name='eleA' type='xsd:string' final='restriction'/>
  <xsd:element name='eleB' substitutionGroup='eleA'>
    <xsd:simpleType>
      <xsd:restriction base='xsd:string'>
        <xsd:maxLength value='20' />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:element>
  <xsd:element name='eleSeq'>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref='eleA' />
        <xsd:element ref='eleB' />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>
[Script]

Implementation Syntax

var enuSubstitutionGroupExclusions = oISchemaAttribute. substitutionGroupExclusions;

Parameters

None.

Return Values

enuSubstitutionGroupExclusions
An enumerated value. The substitution group exclusions. The following values are possible.

SCHEMADERIVATIONMETHOD_EXTENSION SCHEMADERIVATIONMETHOD_RESTRICTION

SCHEMADERIVATIONMETHOD_ALL

[Visual Basic]

Implementation Syntax

enuSubstitutionGroupExclusions = oISchemaAttribute. substitutionGroupExclusions

Parameters

None.

Return Values

enuSubstitutionGroupExclusions
An enumerated value. The substitution group exclusions. The following values are possible.

SCHEMADERIVATIONMETHOD_EXTENSION SCHEMADERIVATIONMETHOD_RESTRICTION

SCHEMADERIVATIONMETHOD_ALL

[C/C++]

Implementation Syntax

HRESULT get_substitutionGroupExclusions(SCHEMADERIVATIONMETHOD* substitutionGroupExclusions);

Parameters

substitutionGroupExclusions [out,retval]
An enumerated value. The following values are possible. SCHEMADERIVATIONMETHOD_EXTENSION

SCHEMADERIVATIONMETHOD_RESTRICTION

SCHEMADERIVATIONMETHOD_ALL

Return Values

S_OK
The value returned if successful.
E_POINTER
The value returned if the substitutionsGroupExclusions parameter is NULL.

To view reference information for Visual Basic or C/C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Applies to: ISchemaElement Interface