File: simple_content.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 (46 lines) | stat: -rw-r--r-- 1,120 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
39
40
41
42
43
44
45
46
# test elements with simpleContent and attributes

--- |
  <?xml version="1.0" encoding="UTF-8"?>
  <schema xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="foo">
      <complexType>
        <sequence>
          <element name="integer" maxOccurs="unbounded">
             <complexType>
               <simpleContent>
                  <extension base="integer">
                     <attribute name="color" type="string" use="required"/>
                     <attribute name="flavor" type="string" use="optional"/>
                  </extension>
               </simpleContent>
             </complexType>
          </element>
        </sequence>
      </complexType>
    </element>
  </schema>

--- |
  <foo>
    <integer color="blue">10</integer>
    <integer color="red" flavor="hot">-1000</integer>
  </foo>
--- >
PASS

--- |
  <foo>
    <integer color="blue">aaa</integer>
    <integer color="red" flavor="hot">-1000</integer>
  </foo>
--- >
FAIL /[iI]llegal value/

--- |
  <foo>
    <integer>10</integer>
    <integer color="red" flavor="hot">-1000</integer>
  </foo>
--- >
FAIL /[mM]issing required/