|
root / base / usr / src / contrib / libxml2 / test / schemas / restrict-CT-attr-ref_0.xsd
restrict-CT-attr-ref_0.xsd XML 30 lines 780 B
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	attributeFormDefault="qualified"
	xmlns:foo="http://FOO"
	targetNamespace="http://FOO">

	<xsd:attribute name="id" type="xsd:ID"/>

	<xsd:complexType name="typeIDAttr">
    		<xsd:attribute ref="foo:id"/>
	</xsd:complexType>

	<xsd:simpleType name="fooID">
    		<xsd:restriction base="xsd:ID">
      			<xsd:pattern value="b\d{10}"/>
    		</xsd:restriction>
  	</xsd:simpleType>

	<xsd:element name="foo">
    		<xsd:complexType>
      			<xsd:complexContent>
        			<xsd:restriction base="foo:typeIDAttr">         
          				<xsd:attribute name="id" type="foo:fooID"/>
        			</xsd:restriction>
      			</xsd:complexContent>
    		</xsd:complexType>
  	</xsd:element>


</xsd:schema>