File: attribute_ref.yml

package info (click to toggle)
libxml-validator-schema-perl 1.10-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 708 kB
  • sloc: perl: 3,682; xml: 16; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
# test a simple schema that uses attribute refs

--- |
  <?xml version="1.0" encoding="UTF-8"?>
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <xs:simpleType name="color">
       <xs:restriction base="xs:string">
         <xs:enumeration value="red" />
         <xs:enumeration value="white" />
         <xs:enumeration value="blue" />
       </xs:restriction>
     </xs:simpleType>
     <xs:attribute name="color" type="color" />
     <xs:element name="foo">
      <xs:complexType>
       <xs:simpleContent>
          <xs:extension base="xs:string">
             <xs:attribute ref="color" use="required"/>
          </xs:extension>
       </xs:simpleContent>
     </xs:complexType>
   </xs:element>
  </xs:schema>

--- |
 <foo color="red">bar</foo>
--- >
PASS

--- |
 <foo color="yellow">bar</foo>
--- >
FAIL /[iI]llegal value/

--- |
 <foo>bar</foo>
--- >
FAIL /[mM]issing required/