XML element names Rules for Scalar Components

OGC 08-094r1 SWE Common Data Model Requirement http:www.opengis.netspecSWE2.0reqxml-encoding-rulesscalar-encoding-elt-valid Req 95. Scalar components values shall be XML encoded with a single element containing the value as its text content and no other child element. Examples of scalar values encoded in XML are given below: ns:status OFF ns:status ns:time 2009-01-02T23:45:12Z ns:time ns:temp 25.5 ns:temp NIL values are included as the text content of the XML element representing scalar components, in the same way regular scalar values would be included.

9.3.3 Rules for Range Components

Range components are encoded by an XML element whose name corresponds to the soft- typed property containing the component which itself contain two minmax elements carrying the range extreme values. Requirement http:www.opengis.netspecSWE2.0reqxml-encoding-rulesrange-encoding-elt-valid Req 96. Range components values shall be XML encoded with an element containing two sub‐elements with local names “min” and “max” which respectively contain the lower and upper values of the range as their text content. Let us consider the example of “TimeRange” below: swe:field name = SurveyPeriod swe:TimeRange definition = http:www.opengis.netdefpropertyEO0SurveyPeriod referenceFrame =”…” swe:uom xlink:href = http:www.opengis.netdefuomISO-86010Gregorian swe:TimeRange swe:field Following Req 96, this component values are encoded as XML as shown below: ns:SurveyPeriod ns:min 2009-01-02T23:45:12Z ns:min ns:max 2009-01-02T23:45:12Z ns:max ns:SurveyPeriod 128 Copyright © 2011 Open Geospatial Consortium SWE Common Data Model OGC 08-094r1

9.3.4 Rules for DataRecord and Vector

Aggregate components are encoded by using a parent element with the proper local name as enforced by Req 94 to which elements for sub-components are appended recursively. Elements normally corresponding to record fields marked as optional can be completely omitted since parsers can use element names to unambiguously know the ones that are missing. Requirement http:www.opengis.netspecSWE2.0reqxml-encoding-rulesrecord-wrapper-elt-valid Req 97. “DataRecord” values shall be XML encoded with an element which contains one sub‐element for each “field” that is not omitted when optional. Requirement http:www.opengis.netspecSWE2.0reqxml-encoding-rulesvector-wrapper-elt-valid Req 98. “Vector” values shall be XML encoded with an element which contains one sub ‐element for each “coordinate” of the aggregate. The curve data example introduced in section 9.2.4 would be encoded in XML as shown below: swe:encoding swe:XMLEncoding swe:encoding swe:values xmlns:ns = http:www.myorg.comdatasetsid ns:point ns:temp ns:temp ns:error 5 ns:error ns:point ns:point ns:temp 10 ns:temp ns:error 2 ns:error ns:point ns:point ns:temp 50 ns:temp ns:error 2 ns:error ns:point ns:point ns:temp 80 ns:temp ns:error 5 ns:error ns:point ns:point ns:temp 100 ns:temp ns:error 15 ns:error ns:point swe:values In this example, the array element type is called ‘point’ and is defined as a “DataRecord” that contains two scalar fields called ‘temp’ and ‘error’. These soft-typed property names are thus used as the element local names of encoded values. Copyright © 2011 Open Geospatial Consortium 129