Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pygcam XML schema definitions
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'>
<xs:simpleType name="runForType">
<xs:restriction base="xs:string">
<xs:enumeration value="baseline"/>
<xs:enumeration value="policy"/>
<xs:enumeration value="all"/>
</xs:restriction>
</xs:simpleType>
<xs:element name='projects'>
<xs:complexType>
<xs:choice maxOccurs='unbounded'>
<xs:element ref='defaults'/>
<xs:element ref='project'/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name='defaults'>
<xs:complexType>
<xs:choice maxOccurs='unbounded'>
<xs:element ref='steps'/>
<xs:element ref='tmpFile'/>
<xs:element ref='vars'/>
<xs:element ref='queries'/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name='project'>
<xs:complexType>
<xs:choice maxOccurs='unbounded'>
<xs:element ref='steps'/>
<xs:element ref='tmpFile'/>
<xs:element ref='vars'/>
<xs:element ref='scenarioGroup'/>
<xs:element ref='queries'/>
</xs:choice>
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='subdir' type='xs:string'/>
</xs:complexType>
</xs:element>
<xs:element name='scenarioGroup'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='scenario'/>
</xs:sequence>
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='default' type='xs:boolean' default='false'/>
<xs:attribute name="useGroupDir" type='xs:boolean' default='false'/>
</xs:complexType>
</xs:element>
<xs:element name='scenario'>
<xs:complexType>
<xs:attribute name='active' type='xs:boolean' default='true'/>
<xs:attribute name='baseline' type='xs:boolean' default='false'/>
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='subdir' type='xs:string'/>
</xs:complexType>
</xs:element>
<xs:element name='steps'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='step'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='step'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='runFor' type='runForType' default='all'/>
<xs:attribute name='group' type='xs:string' default=''/>
<xs:attribute name='seq' type='xs:integer' default='0'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='vars'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='var'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='var'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name='configVar' type='xs:string'/>
<xs:attribute name='eval' type='xs:boolean' default='false'/>
<xs:attribute name='name' use='required' type='xs:string'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='tmpFile'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='text'/>
</xs:sequence>
<xs:attribute name='delete' type='xs:boolean' default="true"/>
<xs:attribute name='eval' type='xs:boolean' default="true"/>
<xs:attribute name='replace' type='xs:boolean' default="false"/>
<xs:attribute name='varName' use='required' type='xs:string'/>
<xs:attribute name='dir' type='xs:string'/>
</xs:complexType>
</xs:element>
<xs:element name='text'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name='tag' type='xs:string'/>
<xs:attribute name='args' type='xs:string'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='queries'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='query'/>
</xs:sequence>
<xs:attribute name='varName' use='required' type='xs:string'/>
<xs:attribute name='defaultMap' type='xs:string'/>
<xs:attribute name='delete' type='xs:boolean'/>
</xs:complexType>
</xs:element>
<xs:element name='query'>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs='unbounded'>
<xs:element ref='rewriter'/>
</xs:choice>
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='useDefault' type='xs:boolean'/>
</xs:complexType>
</xs:element>
<xs:element name='rewriter'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='level' type='xs:string'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!-- Derived using MOSO Xmplify 1.7.6 by Richard Plevin on 2016-02-04 22:54:01 +0000 -->
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'>
<xs:simpleType name="landClassType">
<xs:restriction base="xs:string">
<xs:enumeration value="UnmanagedPasture"/>
<xs:enumeration value="UnmanagedForest"/>
<xs:enumeration value="Shrubland"/>
<xs:enumeration value="Grassland"/>
<xs:enumeration value="OtherArableLand"/>
</xs:restriction>
</xs:simpleType>
<xs:element name='region' type='xs:string'/>
<xs:element name='landClass' type='landClassType'/>
<xs:element name='landProtection'>
<xs:complexType>
<xs:choice maxOccurs='unbounded'>
<xs:element ref='group'/>
<xs:element ref='scenario'/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name='group'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='region'/>
</xs:sequence>
<xs:attribute name='name' use='required' type='xs:string'/>
</xs:complexType>
</xs:element>
<xs:element name='scenario'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='protectedRegion'/>
</xs:sequence>
<xs:attribute name='name' use='required' type='xs:string'/>
</xs:complexType>
</xs:element>
<xs:element name='protectedRegion'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='protection'/>
</xs:sequence>
<xs:attribute name='name' use='required' type='xs:string'/>
</xs:complexType>
</xs:element>
<xs:element name='protection'>
<xs:complexType>
<xs:sequence>
<xs:element ref='fraction'/>
<xs:sequence maxOccurs='unbounded'>
<xs:element ref='landClass'/>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='fraction'>
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0.0"/>
<xs:maxInclusive value="1.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'>
<xs:element name='queries'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='query'/>
</xs:sequence>
<xs:attribute name='defaultMap' type='xs:string'/>
<xs:attribute name='varName' type='xs:string'/>
<xs:attribute name='delete' type='xs:boolean'/>
</xs:complexType>
</xs:element>
<xs:element name='query'>
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs='unbounded'>
<xs:element maxOccurs='unbounded' ref='rewriter'/>
</xs:choice>
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='useDefault' type='xs:boolean'/>
</xs:complexType>
</xs:element>
<xs:element name='rewriter'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='level' type='xs:string'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'>
<xs:element name='rewriteSets'>
<xs:complexType>
<xs:choice maxOccurs='unbounded'>
<xs:element ref='rewriteSet'/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name='rewriteSet'>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs='unbounded' ref='rewrite'/>
</xs:sequence>
<xs:attribute name='name' use='required' type='xs:string'/>
<xs:attribute name='level' use='required' type='xs:string'/>
<xs:attribute name='byAEZ' type='xs:string'/>
<xs:attribute name='append-values' type='xs:boolean'/>
</xs:complexType>
</xs:element>
<xs:element name='rewrite'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name='to' use='required' type='xs:string'/>
<xs:attribute name='from' use='required' type='xs:string'/>
<xs:attribute name='byAEZ' type='xs:string'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
@rjplevin

This comment has been minimized.

Copy link
Owner Author

rjplevin commented Aug 20, 2016

These files define the schema for XML input files used by the pygcam package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.