Skip to content

Commit

Permalink
xsd-examples/
Browse files Browse the repository at this point in the history
  • Loading branch information
dkdndes committed Jan 30, 2015
1 parent 5a829bb commit da1539e
Show file tree
Hide file tree
Showing 2 changed files with 360 additions and 0 deletions.
97 changes: 97 additions & 0 deletions xsd-examples/DWML.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0"?>

<!-- **********************************************************************
DWML.xsd - Top level XML Schema for Digital Weather Markup Language
John L. Schattel MDL 4 August 2004
Red Hat Linux Apache Server
Paul Hershberg MDL 11 July 2007
-Added keyref for new <moreWeatherInformation> element.
<xsd:include schemaLocation="http://graphical.weather.gov/xml/DWMLgen/schema/meta_data.xsd" />
<xsd:include schemaLocation="http://graphical.weather.gov/xml/DWMLgen/schema/ndfd_data.xsd" />
************************************************************************* -->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:include schemaLocation="http://graphical.weather.gov/xml/DWMLgen/schema/meta_data.xsd" />
<xsd:include schemaLocation="http://graphical.weather.gov/xml/DWMLgen/schema/ndfd_data.xsd" />

<xsd:simpleType name="latLonListType">
<xsd:restriction base="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en">
This expression enforces a space delimited list
of latitude longitude pairs. The latitude and
longitude values are delimited by a comma
(i.e. 38.00,-100.00 40.00,-78.00)
</xsd:documentation>
</xsd:annotation>
<xsd:pattern value="[\-]?\d{1,2}\.\d+,[\-]?\d{1,3}\.\d+( [\-]?\d{1,2}\.\d+,[\-]?\d{1,3}\.\d+)*" />
</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="cityNameListType">
<xsd:restriction base="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en">
This expression enforces a coma delimited list city names.
The city names are ordered to match the cities latitude
and longitude value in the accompanying latLonListType element
(i.e. Dallas,Los Angeles,Salt Lake City)
</xsd:documentation>
</xsd:annotation>
<xsd:pattern value="[a-zA-Z'\-]*( ?[a-zA-Z'\-]*)*,[A-Z][A-Z](\|[a-zA-Z'\-]*( ?[a-zA-Z'\-]*)*,[A-Z][A-Z])*" />
</xsd:restriction>
</xsd:simpleType>

<xsd:element name="dwml">
<xsd:complexType>
<xsd:choice>
<xsd:sequence>
<xsd:element name="head" type="headType" minOccurs="1" maxOccurs="1" />
<xsd:element name="data" type="dataType" minOccurs="1" maxOccurs="unbounded">
<xsd:keyref name="applicable-locationKey" refer="locationKey">
<xsd:selector xpath="data/parameters" />
<xsd:field xpath="@applicable-location" />
</xsd:keyref>
<xsd:keyref name="moreWeatherInformationKey" refer="locationKey">
<xsd:selector xpath="data/moreWeatherInformation" />
<xsd:field xpath="@applicable-location" />
</xsd:keyref>
<xsd:keyref name="applicable-timeKey" refer="timeKey">
<xsd:selector xpath="data/parameters/*" />
<xsd:field xpath="@time-layout" />
</xsd:keyref>
<xsd:keyref name="applicable-categoriesKey" refer="categoriesKey">
<xsd:selector xpath="data/parameters/*" />
<xsd:field xpath="@applicable-categories" />
</xsd:keyref>
<xsd:key name="locationKey">
<xsd:selector xpath=".//location" />
<xsd:field xpath="location-key" />
</xsd:key>
<xsd:key name="timeKey">
<xsd:selector xpath=".//time-layout" />
<xsd:field xpath="layout-key" />
</xsd:key>
<xsd:key name="categoriesKey">
<xsd:selector xpath=".//categories" />
<xsd:field xpath="categories-key" />
</xsd:key>
</xsd:element>
</xsd:sequence>
<xsd:sequence>
<xsd:element name="minResolution" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
<xsd:element name="latLonList" type="latLonListType" />
<xsd:element name="cityNameList" type="cityNameListType" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:choice>
<xsd:attribute name="version" type="xsd:string" default="1.0" />
</xsd:complexType>
</xsd:element>

</xsd:schema>
263 changes: 263 additions & 0 deletions xsd-examples/wadl.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://wadl.dev.java.net/2009/02"
xmlns:tns="http://wadl.dev.java.net/2009/02"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
elementFormDefault="qualified">

<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>

<xs:element name="application">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:grammars" minOccurs="0"/>
<xs:element ref="tns:resources" minOccurs="0"
maxOccurs="unbounded"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="tns:resource_type"/>
<xs:element ref="tns:method"/>
<xs:element ref="tns:representation"/>
<xs:element ref="tns:param"/>
</xs:choice>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="doc">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="title" type="xs:string"/>
<xs:attribute ref="xml:lang"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:element name="grammars">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="tns:include"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="resources">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:resource" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="base" type="xs:anyURI"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:element name="resource">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:param" minOccurs="0" maxOccurs="unbounded"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="tns:method"/>
<xs:element ref="tns:resource"/>
</xs:choice>
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
processContents="lax"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="type" type="tns:resource_type_list"/>
<xs:attribute name="queryType" type="xs:string"
default="application/x-www-form-urlencoded"/>
<xs:attribute name="path" type="xs:string"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:simpleType name="resource_type_list">
<xs:list itemType="xs:anyURI"/>
</xs:simpleType>

<xs:element name="resource_type">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:param" minOccurs="0" maxOccurs="unbounded"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="tns:method"/>
<xs:element ref="tns:resource"/>
</xs:choice>
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
processContents="lax"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:element name="method">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:request" minOccurs="0"/>
<xs:element ref="tns:response" minOccurs="0"
maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="name" type="tns:Method"/>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:simpleType name="Method">
<xs:union memberTypes="tns:HTTPMethods xs:NMTOKEN"/>
</xs:simpleType>

<xs:simpleType name="HTTPMethods">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="GET"/>
<xs:enumeration value="POST"/>
<xs:enumeration value="PUT"/>
<xs:enumeration value="HEAD"/>
<xs:enumeration value="DELETE"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="include">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:element name="request">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:param" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:representation" minOccurs="0"
maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:element name="response">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:param" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:representation" minOccurs="0"
maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="status" type="tns:statusCodeList"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:simpleType name="uriList">
<xs:list itemType="xs:anyURI"/>
</xs:simpleType>

<xs:element name="representation">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:param" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="element" type="xs:QName"/>
<xs:attribute name="mediaType" type="xs:string"/>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:attribute name="profile" type="tns:uriList"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:simpleType name="statusCodeList">
<xs:list itemType="xs:unsignedInt"/>
</xs:simpleType>

<xs:simpleType name="ParamStyle">
<xs:restriction base="xs:string">
<xs:enumeration value="plain"/>
<xs:enumeration value="query"/>
<xs:enumeration value="matrix"/>
<xs:enumeration value="header"/>
<xs:enumeration value="template"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="param">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:option" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tns:link" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:attribute name="name" type="xs:NMTOKEN"/>
<xs:attribute name="style" type="tns:ParamStyle"/>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="type" type="xs:QName" default="xs:string"/>
<xs:attribute name="default" type="xs:string"/>
<xs:attribute name="required" type="xs:boolean" default="false"/>
<xs:attribute name="repeating" type="xs:boolean" default="false"/>
<xs:attribute name="fixed" type="xs:string"/>
<xs:attribute name="path" type="xs:string"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:element name="option">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute name="mediaType" type="xs:string"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

<xs:element name="link">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:doc" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="resource_type" type="xs:anyURI"/>
<xs:attribute name="rel" type="xs:token"/>
<xs:attribute name="rev" type="xs:token"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
</xs:element>

</xs:schema>

0 comments on commit da1539e

Please sign in to comment.