vtm/resources/rendertheme.xsd

268 lines
11 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://opensciencemap.org/rendertheme"
xmlns:tns="http://opensciencemap.org/rendertheme" elementFormDefault="qualified" xml:lang="en">
<!-- attribute types -->
<xs:simpleType name="cap">
<xs:restriction base="xs:string">
<xs:enumeration value="butt" />
<xs:enumeration value="round" />
<xs:enumeration value="square" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="closed">
<xs:restriction base="xs:string">
<xs:enumeration value="yes" />
<xs:enumeration value="no" />
<xs:enumeration value="any" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="color">
<xs:restriction base="xs:string">
<xs:pattern value="#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="elementList">
<xs:restriction base="xs:string">
<xs:enumeration value="node" />
<xs:enumeration value="way" />
<xs:enumeration value="any" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="selectorList">
<xs:restriction base="xs:string">
<xs:enumeration value="first" />
<xs:enumeration value="any" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="fontFamily">
<xs:restriction base="xs:string">
<xs:enumeration value="default" />
<xs:enumeration value="default_bold" />
<xs:enumeration value="monospace" />
<xs:enumeration value="sans_serif" />
<xs:enumeration value="serif" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="fontStyle">
<xs:restriction base="xs:string">
<xs:enumeration value="bold" />
<xs:enumeration value="bold_italic" />
<xs:enumeration value="italic" />
<xs:enumeration value="normal" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="nonNegativeFloat">
<xs:restriction base="xs:float">
<xs:minInclusive value="0" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="src">
<xs:restriction base="xs:string">
<!-- <xs:pattern value="(jar|file)\:.+" /> -->
<xs:pattern value=".+" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="strokeDasharray">
<xs:restriction base="xs:string">
<xs:pattern value="([0-9]+(\.[0-9]+)? *, *[0-9]+(\.[0-9]+)? *, *)*[0-9]+(\.[0-9]+)? *, *[0-9]+(\.[0-9]+)?" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="textKey">
<xs:restriction base="xs:string">
<xs:enumeration value="ele" />
<xs:enumeration value="addr:housenumber" />
<xs:enumeration value="name" />
<xs:enumeration value="ref" />
</xs:restriction>
</xs:simpleType>
<!-- rendering instructions -->
<xs:complexType name="area">
<xs:attribute name="id" type="xs:string" use="optional" default="0" />
<xs:attribute name="use" type="xs:string" use="optional" default="0" />
<xs:attribute name="src" type="tns:src" use="optional" />
<xs:attribute name="fill" type="tns:color" use="optional" default="#000000" />
<xs:attribute name="stroke" type="tns:color" use="optional" default="#00000000" />
<xs:attribute name="stroke-width" type="tns:nonNegativeFloat" use="optional" default="0" />
<xs:attribute name="fade" type="xs:integer" use="optional" default="-1" />
<xs:attribute name="blend" type="xs:integer" use="optional" default="-1" />
<xs:attribute name="blend-fill" type="tns:color" use="optional" default="#000000" />
</xs:complexType>
<xs:complexType name="caption">
<xs:attribute name="k" type="tns:textKey" use="required" />
<xs:attribute name="dy" type="xs:float" use="optional" default="0" />
<xs:attribute name="font-family" type="tns:fontFamily" use="optional" default="default" />
<xs:attribute name="style" type="tns:fontStyle" use="optional" default="normal" />
<xs:attribute name="size" type="tns:nonNegativeFloat" use="optional" default="0" />
<xs:attribute name="fill" type="tns:color" use="optional" default="#000000" />
<xs:attribute name="stroke" type="tns:color" use="optional" default="#000000" />
<xs:attribute name="stroke-width" type="tns:nonNegativeFloat" use="optional" default="0" />
<!-- priority for label placement, 0 = highest priority -->
<xs:attribute name="priority" type="xs:integer" use="optional" default="0" />
<!-- symbol src name in atlas -->
<xs:attribute name="symbol" type="tns:src" use="optional" />
</xs:complexType>
<xs:complexType name="circle">
<xs:attribute name="r" type="tns:nonNegativeFloat" use="required" />
<xs:attribute name="scale-radius" type="xs:boolean" use="optional" default="false" />
<xs:attribute name="fill" type="tns:color" use="optional" default="#00000000" />
<xs:attribute name="stroke" type="tns:color" use="optional" default="#00000000" />
<xs:attribute name="stroke-width" type="tns:nonNegativeFloat" use="optional" default="0" />
</xs:complexType>
<xs:complexType name="line">
<!-- style: TODO only in style-line-->
<xs:attribute name="id" type="xs:string" use="optional" default="0" />
<!-- inherited style -->
<xs:attribute name="use" type="xs:string" use="optional" default="0" />
<xs:attribute name="src" type="tns:src" use="optional" />
<xs:attribute name="stroke" type="tns:color" use="optional" default="#000000" />
<xs:attribute name="width" type="xs:float" use="optional" default="0" />
<!-- minimum scaled width to draw outline -->
<xs:attribute name="min" type="xs:float" use="optional" default="0" />
<xs:attribute name="dasharray" type="tns:strokeDasharray" use="optional" />
<xs:attribute name="cap" type="tns:cap" use="optional" default="round" />
<xs:attribute name="outline" type="xs:string" use="optional" default="" />
<xs:attribute name="fade" type="xs:integer" use="optional" default="-1" />
<xs:attribute name="blur" type="xs:float" use="optional" default="-1" />
<xs:attribute name="fix" type="xs:boolean" use="optional" default="false" />
<!-- stipple repeat in 'pixel' -->
<xs:attribute name="stipple" type="xs:integer" use="optional" default="0" />
<!-- stipple color -->
<xs:attribute name="stipple-stroke" type="tns:color" use="optional" default="#000000" />
<!-- stipple width relative to line width, i.e 0.0-1.0 -->
<xs:attribute name="stipple-width" type="xs:float" use="optional" default="0" />
</xs:complexType>
<!-- <xs:complexType name="outline">
<xs:attribute name="name" type="xs:string" use="optional"
default="0" />
<xs:attribute name="src" type="tns:src" use="optional" />
<xs:attribute name="stroke" type="tns:color" use="optional"
default="#000000" />
<xs:attribute name="stroke-width" type="tns:nonNegativeFloat"
use="optional" default="0" />
</xs:complexType>
-->
<xs:complexType name="lineSymbol">
<xs:attribute name="src" type="tns:src" use="required" />
<xs:attribute name="align-center" type="xs:boolean" use="optional" default="false" />
<xs:attribute name="repeat" type="xs:boolean" use="optional" default="false" />
</xs:complexType>
<xs:complexType name="text">
<xs:attribute name="id" type="xs:string" use="optional" default="0" />
<xs:attribute name="use" type="xs:string" use="optional" default="0" />
<xs:attribute name="k" type="tns:textKey" use="optional" default="name" />
<xs:attribute name="dy" type="xs:float" use="optional" default="0" />
<xs:attribute name="font-family" type="tns:fontFamily" use="optional" default="default" />
<xs:attribute name="style" type="tns:fontStyle" use="optional" default="normal" />
<xs:attribute name="size" type="tns:nonNegativeFloat" use="optional" default="0" />
<xs:attribute name="fill" type="tns:color" use="optional" default="#000000" />
<xs:attribute name="stroke" type="tns:color" use="optional" default="#000000" />
<xs:attribute name="stroke-width" type="tns:nonNegativeFloat" use="optional" default="0" />
<xs:attribute name="caption" type="xs:boolean" use="optional" default="false" />
<!-- priority for label placement, 0 = highest priority -->
<xs:attribute name="priority" type="xs:integer" use="optional" default="0" />
</xs:complexType>
<xs:complexType name="symbol">
<xs:attribute name="src" type="tns:src" use="required" />
</xs:complexType>
<xs:complexType name="extrusion">
<xs:attribute name="line-color" type="tns:color" use="optional" />
<xs:attribute name="side-color" type="tns:color" use="required" />
<xs:attribute name="top-color" type="tns:color" use="required" />
</xs:complexType>
<!-- match elements -->
<xs:complexType name="m">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<!-- recursion to allow for nested m -->
<xs:element name="m" type="tns:m" />
<xs:element name="area" type="tns:area" />
<xs:element name="caption" type="tns:caption" />
<xs:element name="circle" type="tns:circle" />
<xs:element name="line" type="tns:line" />
<xs:element name="outline" type="tns:line" />
<xs:element name="lineSymbol" type="tns:lineSymbol" />
<xs:element name="text" type="tns:text" />
<xs:element name="extrusion" type="tns:extrusion" />
<xs:element name="symbol" type="tns:symbol" />
<!-- outline is defined within rules to match layering -->
<xs:element name="outline-layer" type="tns:line" />
</xs:choice>
<xs:attribute name="select" type="tns:selectorList" use="optional" default="any"/>
<xs:attribute name="e" type="tns:elementList" use="optional" />
<xs:attribute name="k" type="xs:string" use="optional" />
<xs:attribute name="v" type="xs:string" use="optional" />
<xs:attribute name="closed" type="tns:closed" use="optional" default="any" />
<xs:attribute name="zoom-min" type="xs:unsignedByte" use="optional" default="0" />
<xs:attribute name="zoom-max" type="xs:unsignedByte" use="optional" default="127" />
</xs:complexType>
<xs:complexType name="atlas">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<!-- TODO -->
<xs:element name="rect"></xs:element>
</xs:choice>
<xs:attribute name="img" type="xs:string" use="required" />
</xs:complexType>
<!-- rendertheme element -->
<xs:complexType name="rendertheme">
<xs:sequence minOccurs="0" maxOccurs="1">
<!-- style definitions -->
<xs:sequence minOccurs="0" maxOccurs="256">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="style-text" type="tns:text" />
<xs:element name="style-area" type="tns:area" />
<xs:element name="style-line" type="tns:line" />
<!-- <xs:element name="style-outline" type="tns:line" /> -->
</xs:choice>
</xs:sequence>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element name="atlas" type="tns:atlas"/>
</xs:choice>
<!-- matching rules -->
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="m" type="tns:m" />
</xs:sequence>
</xs:sequence>
<xs:attribute name="version" type="xs:positiveInteger" use="required" />
<xs:attribute name="map-background" type="tns:color" use="optional" default="#ffffff" />
<xs:attribute name="base-stroke-width" type="tns:nonNegativeFloat" use="optional" default="1" />
<xs:attribute name="base-text-size" type="tns:nonNegativeFloat" use="optional" default="1" />
</xs:complexType>
<!-- root element -->
<xs:element name="rendertheme" type="tns:rendertheme" />
</xs:schema>