Sections are a group of fields that are related to each other. Sections must have a name and usually have at least one mapping and one field. Shown below is an excerpt from an XSD file that illustrates defining a section.
<xs:documentation>Contains information about the Location.</xs:documentation>
<edd:table mode="lookup" target="rt_location_type">
<edd:lookup source="loc_type" target="location_type_code" />
... other table mappings omitted ...
<xs:element name="elev_unit" type="elev_unit" nillable="true">
<xs:documentation>Unit of measurement for elevations</xs:documentation>
... other fields omitted ...
In the first line, the attribute name defines the name of the table. The text between the documentation tags on the third line is the tooltip text (text displayed when you pause on the section name in EDP) for the section. The text between the group tags on the fifth line is the name of the section group which the field belongs to, and is not required. Different sections within a section group are usually related to each other.
All table mappings are declared between the appinfo tags as shown by the RT_LOCATION_TYPE table mapping, while all fields are declared between the sequence tags as shown by the ELEV_UNIT field.
Fields are displayed as columns after a section is selected. All fields must have a name, type, and designation as to whether they are required or not. Below is an excerpt from an XSD that illustrates how to declare fields and their properties.
<xs:element name="basis" type="basis" nillable="false" default="WET">
<xs:documentation>Must be either 'Wet' for wet_weight basis reporting, 'Dry' for dry_weight basis reporting, or 'NA' for tests for which this distinction is not applicable. </xs:documentation>
<xs:element name="sample_source" nillable="false" default="Field">
<xs:documentation>This field identifies where the sample came from, either Field or Lab.</xs:documentation>
This excerpt shows four different fields: field “basis”, field “sample_source”, field “dilution_factor” and field “container_id”. The attributes name and nillable are required for all fields. The attribute name defines the name of the field and the attribute nillable defines whether or not the field is required to have a value in every row of data.
A nillable value of false, means the field is required. A nillable value of true, means the field is not required. There are four ways to declare the type of a field.
1.The first field is an enumeration type of “basis” defined by the type attribute.
2.The second field is an enumeration or text values defined by the enumeration tags within the restriction tag. The enumeration declared in the second field can only be used by that field, while the enumeration in the first field can also be used by several other fields.
3.The third field is of type numeric (“xs:decimal” means numeric) and
4.The fourth field is of type text (“xs:string” means text) defined by the base attribute in the restriction tag. In the third field, the maximum number of digits you are allowed to the right of the decimal is three and the total number of digits that can be entered is seven. In the fourth field, the maximum number of characters you can enter is 30, defined by the value attribute in the maxLength tag.
Fields may also have the attribute default to specify a default value as shown in the first two fields. This attribute can be used when a new row of data is created in EDP. The text between the documentation tags is the tooltip text (displayed when you pause on the field header in EDP) for the field.
Copyright © 2021 EarthSoft, Inc • Modified: 08 Apr 2020