W3C

AttributeGroupExample Example

  <xs:element name="attributeGroupExample" type="ex:AttributeGroupExample"/>

  <xs:complexType name="AttributeGroupExample">
            <xs:sequence>
               <xs:element name="contract" type="xs:string"/>
            </xs:sequence>
            <xs:attributeGroup ref="ex:CommonAttributesExample"/>
         </xs:complexType>

  <xs:attributeGroup name="CommonAttributesExample">
            <xs:attribute name="id" type="xs:ID" use="optional" form="unqualified"/>
         </xs:attributeGroup>

The example schema [AttributeGroupExample.xsd] has been classified as being "pending" as it exhibits the following patterns:

Status Name XPath
basic TargetNamespace .[@targetNamespace]/ (., @targetNamespace)
basic QualifiedLocalElements .[@elementFormDefault = 'qualified']/ (@elementFormDefault)
basic UnqualifiedLocalAttributes .[not(@attributeFormDefault) or @attributeFormDefault = 'unqualified']/ (., @attributeFormDefault)
basic IdentifierName .//.[matches(@name, "^[A-Za-z_]([A-Za-z0-9_]0 31)$")]/ (@name)
basic GlobalElement ./xs:element[@name and @type and contains(@type, ':')]/ (., @name, @type)
basic AttributeFormUnqualified .//xs:attribute[@form='unqualified']/ (@form)
basic AttributeOptional .//xs:attribute[@use = 'optional']/ (@use)
basic GlobalComplexType ./xs:complexType[@name]/ (., @name)
basic ComplexTypeSequence .//xs:complexType/xs:sequence/ (., xs:element/(., @name))
basic ElementTypeReference .//xs:element[@name and @type and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' and contains(@type, ':')]/ (., @name, @type)
basic StringElement .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:string')]
advanced IDAttribute .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:ID')]
pending AttributeGroup .//xs:attributeGroup/((.,@name),(.,@ref),(xs:attribute,@name))

To facilitate testing, the example schema element has been wrapped in the following descriptions:

The following valid instance documents are provided:

Instance Validity
AttributeGroupExample01 true
AttributeGroupExample02 true

  <ex:attributeGroupExample id="AttributeGroupExample_contract_001">
            <ex:contract>12345678910</ex:contract>
         </ex:attributeGroupExample>
  <ex:attributeGroupExample>
            <ex:contract>9876543210</ex:contract>
         </ex:attributeGroupExample>

This document was produced by the W3C XML Schema Patterns for Databinding Working Group. Comments on this document may be sent to the public public-xsd-databinding-comments@w3.org mailing list (public archive).

Generated from examples.xml $Date$