File: attribute_types.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 (56 lines) | stat: -rw-r--r-- 1,312 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
47
48
49
50
51
52
53
54
55
56
# test attribute types

--- |
  <?xml version="1.0" encoding="UTF-8"?>
  <schema xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="foo">
      <complexType>
        <attribute name="no_type" use="optional" />
        <attribute name="int" type="int" use="optional" />
        <attribute name="integer" type="integer" use="optional" />
        <attribute name="name" type="NMTOKEN" use="optional"  />
        <attribute name="string" type="string" use="optional" />
        <attribute name="bool" type="boolean" use="optional" />
        <attribute name="date" type="dateTime" use="optional" />
        <attribute name="foo_or_bar" use="optional">
          <simpleType>
            <restriction base="xsd:string">
              <enumeration value="foo"/>
              <enumeration value="bar"/>
            </restriction>
          </simpleType>
        </attribute>
      </complexType>
    </element>
  </schema>

--- |
  <foo no_type="foo"/>
--- >
PASS

--- |
  <foo int="1" integer="1" name="foo" string="..." bool="true" date="1977-08-02T20:02:00"/>
--- >
PASS

--- |
  <foo int="what are you looking at?" />
--- >
FAIL /[Ii]llegal value/

--- |
  <foo foo_or_bar="foo" />
--- >
PASS

--- |
  <foo foo_or_bar="bar" />
--- >
PASS

--- |
  <foo foo_or_bar="fooz" />
--- >
FAIL /[Ii]llegal value/