OGC 08-094r1 SWE Common Data Model
complexContent extension
base =
swe:AbstractEncodingType complexContent
complexType
The XML Block encoding method is used when data values are to be encoded as light weight XML elements. The way the XML elements are named and structured are tied to
the data structure specified using a hierarchy of data components. The exact encoding rules to be followed are specified in clause 9.3.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-simple-encodingsxml-encoding-rules-applied
Req 76. The encoded values block described by an “XMLEncoding” element shall
pass the “XML Encoding Rules” conformance test class.
108
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
8.6 Requirements Class: Advanced Encodings Schema Requirements Class
http:www.opengis.netspecSWE2.0reqxsd-advanced-encodings
Target Type XML Instance
Dependency
http:www.opengis.netspecSWE2.0requml-advanced-encodings
Dependency
http:www.opengis.netspecSWE2.0reqxsd-simple-encodings
Dependency
http:www.opengis.netspecSWE2.0reqbinary-encoding-rules
This requirement class defines an additional encoding method that is used to encode data values as raw or base64 binary blocks.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-advanced-encodingsdependency-simple-encodings
Req 77. An XML instance passing the “Advanced Encodings Schema” conformance
test class shall first pass the “Simple Encodings Schema” conformance test class.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-advanced-encodingsschema-valid
Req 78. The XML instance shall be valid with respect to the grammar defined in the
“advanced_encodings.xsd” XML schema as well as satisfy all Schematron patterns
defined in “advanced_encodings.sch”.
Note: The raw binary encoding option is not usable within an XML document since it makes use of characters not allowed in XML. Raw binary data can only be provided
separately from the XML document and eventually referenced via an xlink. If there is a requirement for binary data to be included as text content of an XML element, the
‘base64’ byte encoding option should be used.
8.6.1 BinaryEncoding Element
The “BinaryEncoding” element is the XML schema implementation of the “BinaryEncoding” UML class defined in clause 7.7.1. The schema snippet for this
element and its corresponding complex type is shown below:
element name
= BinaryEncoding
type =
swe:BinaryEncodingType substitutionGroup
= swe:AbstractEncoding
Copyright © 2011 Open Geospatial Consortium
109
OGC 08-094r1 SWE Common Data Model
complexType name
= BinaryEncodingType
complexContent extension
base =
swe:AbstractEncodingType sequence
element name
= member
maxOccurs =
unbounded complexType
sequence group
ref =
swe:ComponentOrBlock sequence
complexType element
sequence attribute
name =
byteOrder type
= swe:ByteOrderType
use =
required attribute
name =
byteEncoding type
= swe:ByteEncodingType
use =
required attribute
name =
byteLength type
= integer
use =
optional extension
complexContent complexType
This element makes use of two simple types implementing the “ByteEncoding” and “ByteOrder” UML enumerations respectively:
simpleType name
= ByteEncodingType
restriction base
= string
enumeration value
= base64
enumeration value
= raw
restriction simpleType
simpleType name
= ByteOrderType
restriction base
= string
enumeration value
= bigEndian
enumeration value
= littleEndian
restriction simpleType
The member property allow a choice of “Component” or “Block” sub-elements as defined below:
group name
= ComponentOrBlock
choice element
ref =
swe:Component element
ref =
swe:Block choice
group
The exact encoding rules to be followed when encoding array or stream value with the binary method are specified in clause 9.4.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-advanced-encodingsbinary-encoding-rules-applied
Req 79. The encoded values block described by a “BinaryEncoding” element shall
pass the “Binary Encoding Rules” conformance test class.
110
Copyright © 2011 Open Geospatial Consortium