-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
# Test validation schemas against some example files | ||
|
||
./xsd/validate_schedule_xml.sh https://api.events.ccc.de/congress/2023/schedule.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,17 +13,25 @@ | |
<xs:element type="xs:string" name="version"/> | ||
<xs:element name="conference"> | ||
<xs:complexType> | ||
<xs:all> | ||
<xs:element type="xs:string" name="title"/> | ||
<xs:element type="acronym" name="acronym"/> | ||
|
||
<xs:element type="dateOrDateTimeTZ" name="start" minOccurs="0"/> | ||
<xs:element type="dateOrDateTimeTZ" name="end" minOccurs="0"/> | ||
<xs:element type="xs:integer" name="days" minOccurs="0"/> | ||
<xs:element type="duration" name="timeslot_duration" minOccurs="0"/> | ||
<xs:element type="httpURI" name="base_url" minOccurs="0"/> | ||
<xs:element type="xs:string" name="time_zone_name" minOccurs="0" maxOccurs="1"/> | ||
</xs:all> | ||
<xs:sequence> | ||
<xs:choice minOccurs="0" maxOccurs="unbounded"> | ||
<xs:element type="xs:string" name="title" maxOccurs="1"/> | ||
<xs:element type="acronym" name="acronym" maxOccurs="1"/> | ||
|
||
<xs:element type="dateOrDateTimeTZ" name="start" minOccurs="0" maxOccurs="1"/> | ||
<xs:element type="dateOrDateTimeTZ" name="end" minOccurs="0" maxOccurs="1"/> | ||
<xs:element type="xs:integer" name="days" minOccurs="0" maxOccurs="1"/> | ||
<xs:element type="duration" name="timeslot_duration" minOccurs="0"/> | ||
<xs:element type="httpURI" name="base_url" minOccurs="0" maxOccurs="1"/> | ||
<xs:element type="httpURI" name="logo" minOccurs="0" maxOccurs="1"/> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
<xs:element type="httpURI" name="url" minOccurs="0" maxOccurs="1"/> | ||
<xs:element type="xs:string" name="time_zone_name" minOccurs="0" maxOccurs="1"/> | ||
<xs:element type="color" name="color" minOccurs="0"/> | ||
|
||
<xs:element type="track" name="track" minOccurs="0" maxOccurs="unbounded"/> | ||
</xs:choice> | ||
|
||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element type="day" name="day" maxOccurs="unbounded"/> | ||
|
@@ -79,10 +87,10 @@ | |
<xs:element type="start" name="start"/> | ||
<xs:element type="duration" name="duration"/> | ||
<xs:element type="xs:string" name="abstract"/> | ||
<xs:element type="slug" name="slug"/> | ||
<xs:element type="voc-slug" name="slug"/> | ||
<xs:element type="xs:string" name="track"/> | ||
|
||
<xs:element type="xs:string" name="logo" minOccurs="0"/> | ||
<!-- logo is the path or URL to an image, we use httpURI as type here as apps prefer full URLs now --> | ||
<xs:element type="httpURI" name="logo" minOccurs="0"/> | ||
<xs:element type="persons" name="persons" minOccurs="0"/> | ||
<xs:element type="xs:string" name="language" minOccurs="0"/> | ||
<xs:element type="xs:string" name="description" minOccurs="0"/> | ||
|
@@ -130,13 +138,19 @@ | |
<xs:pattern value="[a-z0-9_-]{4,}"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
<xs:simpleType name="slug"> | ||
|
||
<xs:simpleType name="voc-slug"> | ||
<xs:restriction base="xs:string"> | ||
<xs:pattern value="[a-z0-9_]{4,}-[0-9]{1,6}-[a-z0-9\-_]{4,}"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:simpleType name="slug"> | ||
<xs:restriction base="xs:string"> | ||
<xs:pattern value="[a-z0-9-]{2,}"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:simpleType name="httpURI"> | ||
<xs:restriction base="xs:anyURI"> | ||
<xs:pattern value="https?://.*"/> | ||
|
@@ -149,6 +163,13 @@ | |
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:simpleType name="hexColor"> | ||
<xs:restriction base="xs:string"> | ||
<!-- Pattern for hexadecimal color code: # followed by exactly 6 hexadecimal digits, prefered in lower case --> | ||
This comment has been minimized.
Sorry, something went wrong.
rixx
|
||
<xs:pattern value="#[0-9a-f]{6}"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:complexType name="recording"> | ||
<xs:all> | ||
<xs:element type="xs:string" name="license"/> | ||
|
@@ -163,8 +184,9 @@ | |
<xs:element name="person" minOccurs="0" maxOccurs="unbounded"> | ||
<xs:complexType> | ||
<xs:simpleContent> | ||
<xs:extension base="string-nonempty"> | ||
<xs:attribute type="xs:positiveInteger" name="id"/> | ||
<xs:extension base="xs:string"> | ||
<xs:attribute type="xs:positiveInteger" name="id" /> | ||
<xs:attribute type="uuid" name="guid"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
@@ -199,4 +221,25 @@ | |
</xs:element> | ||
</xs:sequence> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="track"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:string"> | ||
<xs:attribute type="xs:string" name="name" use="required"/> | ||
<xs:attribute type="hexColor" name="color" use="optional"/> | ||
<xs:attribute type="slug" name="slug" use="optional"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="color"> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:string"> | ||
<xs:attribute type="hexColor" name="primary" use="required"/> | ||
<xs:attribute type="hexColor" name="background" use="optional"/> | ||
<xs:anyAttribute processContents="lax"/> <!-- Allows for additional, unspecified attributes --> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
|
||
</xs:schema> |
Would've been nice to know about changes like this ahead of time. This change means that pretalx doesn't pass the schedule.xsd validator anymore, as it used to have an empty
<logo></logo>
tag for proposals without a logo, which is now disallowed on account ofhttpURI
not matching an empty string.