Skip to content

Commit

Permalink
Merge pull request #70 from voc/69-timezone
Browse files Browse the repository at this point in the history
add optional time_zone_name element to schedule XML schema
  • Loading branch information
saerdnaer authored Sep 13, 2020
2 parents ec57260 + 8fb8875 commit db5fde7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions validator/xsd/schedule-without-person.xml.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<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:complexType>
</xs:element>
Expand Down
1 change: 1 addition & 0 deletions validator/xsd/schedule.xml.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<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:complexType>
</xs:element>
Expand Down
11 changes: 6 additions & 5 deletions validator/xsd/validate_schedule_xml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ if [ -z "${xmllint_cmd}" ]; then
exit 1
fi

if [ -z "${curl_cmd}" ]; then
echo "Please install curl!"
fi

if [ -z "${1}" ]; then
echo "Please provide schedule xml http(s) URL."
echo " ${0} http://example.com/schedule.xml"
exit 1
exit 2
fi

if [ ! -e "${xsd_file}" ]; then
echo "schedule.xml.xsd missing!"
exit 1
exit 3
fi

case "$1" in
http://*|https://*)
if [ -z "${curl_cmd}" ]; then
echo "Please install curl!" >&2
exit 4
fi
$curl_cmd $1 2>/dev/null | $xmllint_cmd --noout --schema ${xsd_file} -;;
*)
$xmllint_cmd --noout --schema ${xsd_file} $1;;
Expand Down

0 comments on commit db5fde7

Please sign in to comment.