Appendix LCCSchema XSD - USEPA/ATtILA2 GitHub Wiki

XML Schema Definition (XSD) File

An XML Schema Definition (XSD) file is a type of file used to define the structure and content of an XML file. The supplied file, LCCSchema.xsd, located in the ToolboxSource > LandCoverClassifications folder in the ATtILA toolbox destination folder (see Installing ATtILA), is provided to the user to help verify that any Land Cover Classification Schema XML file created outside of the LCCEditor application contains the necessary XML elements needed by ATtILA. How to use the XSD to validate a custom XML file is described in the XML Validation section of this document.

A copy of LCCSchema.xsd is supplied below:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="lcc" xmlns="lcc" xmlns:k="lcc">
  <xs:element name="lccSchema">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="metadata">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="name"/>
              <xs:element type="xs:string" name="description"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="coefficients">
          <xs:annotation>
            <xs:documentation>
			  * The coefficients node contains coefficients to be assigned to values.
			   
			  * REQUIRED ATTRIBUTES
			  * Id - text, unique identifier
			  * Name - text, word or phrase describing coefficient
			  * fieldName - text, name of field to be created for output
			  *           - must conform to the field naming conventions dictated by the output database system
			  * method - text, "P" or "A", designates "P"ercentage or per unit "A"rea calculation routine
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="coefficient" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                      <xs:attribute name="Id" use="required">
                        <xs:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:enumeration value="NITROGEN"/>
                            <xs:enumeration value="PHOSPHORUS"/>
                            <xs:enumeration value="IMPERVIOUS"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:attribute>
                      <xs:attribute type="xs:string" name="Name" use="required"/>
                      <xs:attribute name="method" use="required">
                        <xs:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:enumeration value="A"/>
                            <xs:enumeration value="P"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:attribute>
                      <xs:attribute name="fieldName" use="required">
                        <xs:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:minLength value="1"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="values">
          <xs:annotation>
            <xs:documentation>
			  * The values node defines the full set of values that can exist in a land cover raster.
			
			  * REQUIRED ATTRIBUTES
			  * Id - integer, raster code
			  *
			  * OPTIONAL ATTRIBUTES
			  * Name - text, word or phrase describing value
			  * excluded - boolean, "true" or "false" or "1" or "0"
			  *          - used to exclude values from effective area calculations
			  *          - excluded=false is the default 
			
			  * A value element can optionally contain one or more coefficient elements

			  * REQUIRED COEFFICIENT ATTRIBUTES
			  * Id - text, must match an Id attribute from a coefficients node element
			  * value - decimal, weighting/calculation factor
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="value" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="coefficient" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute name="Id" use="required"/>
                            <xs:attribute type="xs:decimal" name="value" use="required"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute type="xs:int" name="Id" use="required"/>
                  <xs:attribute type="xs:string" name="Name" use="optional"/>
                  <xs:attribute type="xs:boolean" name="excluded" use="optional"/>
                </xs:complexType>
                <xs:unique name="uniqueCoefficient">
                  <xs:selector xpath="coefficient"/>
                  <xs:field xpath="@Id"/>
                </xs:unique>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="classes">
          <xs:annotation>
            <xs:documentation>
			  * The classes node contains values from a land cover raster grouped into one or more classes.
		
			  * REQUIRED ATTRIBUTES
			  * Id - text, unique identifier, also used for automated generation of output field name
			  *    - must conform to the field naming conventions dictated by the output database system
			
			  * OPTIONAL ATTRIBUTES
			  * Name - text, word or phrase describing class
			  * filter - text, a string of one or more tool name abbreviations separated by a ";"
			  *        - possible abbreviations are: caem, flcp, flcv, lcosp, lcp, np, plcv, pm, rlcp, and splcp
			  *        - used to exclude the class from the selectable classes in the tool's GUI
			  * xxxxField - text, overrides ATtILA-generated field name for output
			  *           - where xxxx equals a tool name abbreviation
			  *           - possible abbreviations are: caem, flcp, flcv, lcosp, lcp, rlcp, and splcp
			  *           - a separate xxxxField attribute can exist for each tool
			  *           - must conform to the field naming conventions dictated by the output database system

			  * A class can contain either values or classes but not both types.
			  * Value elements contain only an Id attribute which refers to a value in a raster.
			  * Values tagged as excluded="true" in the values node should not be included in any class.
            </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="class" maxOccurs="unbounded" minOccurs="1" type="classType"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
    <!--<xs:key name="coefficientKey">
      <xs:selector xpath="k:coefficients/k:coefficient"/>
      <xs:field xpath="@Id"/>
    </xs:key>
    <xs:keyref name="coefficientKeyRef" refer="k:coefficientKey">
      <xs:selector xpath="k:values/k:value/k:coefficient"/>
      <xs:field xpath="@Id"/>
    </xs:keyref>-->
  </xs:element>
  <xs:complexType name="classType">
    <xs:sequence>
      <xs:choice minOccurs="1" maxOccurs="1">
        <xs:element name="class" maxOccurs="unbounded" minOccurs="0" type="classType"/>
        <xs:element name="value" maxOccurs="unbounded" minOccurs="0">
            <xs:complexType>
              <xs:simpleContent>
                <xs:extension base="xs:string">
                  <xs:attribute type="xs:int" name="Id" use="required"/>
                </xs:extension>
              </xs:simpleContent>
            </xs:complexType>
          </xs:element>
      </xs:choice>
    </xs:sequence>
	<xs:attribute name="Id" use="required">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:pattern value="([a-zA-Z0-9_])*"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:attribute>
    <xs:attribute type="xs:string" name="Name" use="optional"/>
	<xs:attribute type="xs:string" name="caemField" use="optional"/>
	<xs:attribute type="xs:string" name="flcpField" use="optional"/>
	<xs:attribute type="xs:string" name="flcvField" use="optional"/>
    <xs:attribute type="xs:string" name="lcpField" use="optional"/>
    <xs:attribute type="xs:string" name="rlcpField" use="optional"/>
    <xs:attribute type="xs:string" name="lcospField" use="optional"/>
    <xs:attribute type="xs:string" name="splcpField" use="optional"/>
    <xs:attribute type="xs:string" name="filter" use="optional"/>
  </xs:complexType>
</xs:schema>

arrow_up Top of the page     |     arrow_left Conversion Factors     |     arrow_right Tool Output Field Names


⚠️ **GitHub.com Fallback** ⚠️