TextEncoding Element Requirements Class: Simple Encodings Schema Requirements Class

SWE Common Data Model OGC 08-094r1 Special characters such as carriage returns CR or line feeds LF can be used as block or token separators by using XML entities. For example new line characters are often used as block separators to cleanly separate blocks of values on successive lines: swe:TextEncoding tokenSeparator = ; blockSeparator = 10; This corresponds to the following data block format: 25.41;10.23;320 25.43;10.23;300 25.39;11.51;310 This is compatible with the CSV format and is often used for compatibility with other software. More than one character can be used as a separator in order to avoid conflicts with characters within the data values themselves. The following example shows this type of usage: swe:TextEncoding tokenSeparator = || blockSeparator = 10; This specifies the following data block format: 25.41||text with spaces||text with carriage return||{special_chars} 25.42||text with spaces||text with carriage return||{special_chars} 25.43||text with spaces||text with carriage return||{special_chars} A compliant parser can successfully parse such a data block because only sequences of characters that perfectly match the separator definition indicate the end of a token or block. Implementations are required to support sequences of characters of any length as separators but small ones i.e. 1 to 3 characters are more efficient and should be used whenever possible. Both “tokenSeparator” and “blockSeparator” can have the same value but this is not recommended as it makes the data block less readable and makes block-level resynchronizations impossible in error prone transmissions.

8.5.3 XMLEncoding Element

The “XMLEncoding” element is the XML schema implementation of the “XMLEncoding” UML class defined in clause 7.6.2. The schema snippet for this element and its corresponding complex type is shown below: element name = XMLEncoding type = swe:XMLEncodingType substitutionGroup = swe:AbstractEncoding complexType name = XMLEncodingType Copyright © 2011 Open Geospatial Consortium 107 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