Freigeben über


2.2.6.1 Common Serialization Rules for XML-Based Formats

AtomPub and custom XML formatted payloads that represent Entity Data Model (EDM) constructs, as specified in [MC-CSDL] and defined in AtomPub Format (section 2.2.6.2) and XML Format (section 2.2.6.5), consist of XML elements and attributes in the XML Namespaces, as specified in [XMLNS], that are shown in the following table. All XML elements and attributes associated with the protocol that is defined in this document and custom XML formats that hold data are defined in the "data service" namespace.

All metadata-related elements that are defined in this document are defined in the "data service metadata" namespace.

Namespace

Namespace URI

Atom 1.0 Namespace

(Atom only)

http://www.w3.org/2005/Atom

The common namespace prefix for this namespace is "atom". Subsequent sections of this document refer to elements and attributes in this namespace by using the notation "atom:elementName".

Data Service Namespace

http://schemas.microsoft.com/ado/2007/08/dataservices

This namespace URI can be changed to something more applicable to the particular service. The namespace URI preceding SHOULD be used if a data service does not wish to use an alternate.

Servers are not required to use the namespace prefix "d" for this namespace. Subsequent sections of this document refer to elements in this namespace by using the notation "d:elementName".

Data Services Metadata Namespace

http://schemas.microsoft.com/ado/2007/08/dataservices/metadata

Servers are not required to use the namespace prefix 'm' for this namespace. Subsequent sections of this document refer to elements in this namespace by using the notation "m:elementName".

Table: Protocol Namespace Definitions

XML payloads defined in this document can use the xml:base [XML-BASE] attribute, as specified in [RFC5023]. A data service and its client MUST understand and appropriately process this directive.

All EDM primitive types represented as XML element values MUST be formatted as defined by the rules in the following EDM Primitive Type Formats for Element Values table. In addition to the rules stated in the table, if the value of a primitive or ComplexType type is null, then the value of the associated XML element MUST be empty. In addition, an m:null attribute with value set to "true" MUST be present on the containing element.

EDM primitive type

ABNF rule for primitive type representation in XML-based payloads

Serialization format (ABNF grammar)

Edm.Binary

binary

binary = <Base64 encoded byte stream. See [RFC4648] for further details>

Edm.Boolean

booleanLiteral

See booleanLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Byte

byteLiteral

See byteLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.DateTime

dateTimeLiteral

See dateTimeLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Decimal

decimalLiteral

See decimalLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Double

doubleLiteral

See doubleLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Single

singleLiteral

See singleLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Guid

guidLiteral

See guidLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Int16

int16Literal

See int16Literal in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Int32

int32Literal

See int32Literal in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Int64

int64Literal

See int64Literal in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.SByte

sbyteliteral

See sbyteliteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.String

stringUriLiteral

See stringUriLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Time

timeLiteral

See timeLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.DateTimeOffset

dateTimeOffsetLiteral

See dateTimeOffsetLiteral in the Literal Form of Entity Data Model Primitive Types table in Abstract Type System (section 2.2.2).

Edm.Geography

N/A

N/A

Edm.GeographyPoint

pointGmlLiteral

pointGmlLiteral = <See [OGC-SFOLECOM] representation for a Point>

Edm.GeographyLineString

lineStringGmlLiteral

lineStringGmlLiteral = <See [OGC-SFOLECOM] representation for a LineString>

Edm.GeographyPolygon

polygonGmlLiteral

polygonGmlLiteral = <See [OGC-SFOLECOM] representation for a Polygon, except as modified below>

In Ellipsoidal coordinates, all rings are equally interpretable as "outer". Therefore, the rings has to have their control points in left-foot winding order. This means that the points to the left side of the ring, when traversing in serialized order, are in the polygon, while those to the right side are not.

In planar coordinates, where "outer" is well defined, the first ring has to be the outer ring, in accordance with the GML standard.

Edm.GeographyCollection

geoCollectionGmlLiteral

geoCollectionGmlLiteral = <See [OGC-SFOLECOM] representation for a GeometryCollection>

Edm.GeographyMultiPoint

multiPointGmlLiteral

multiPointGmlLiteral = <See [OGC-SFOLECOM] representation for a MultiPoint>

Edm.GeographyMultiLineString

multiLineStringGmlLiteral

multiLineStringGmlLiteral = <See [OGC-SFOLECOM] representation for a MultiLineString>

Edm.GeographyMultiPolygon

multiPolygonGmlLiteral

multiPolygonGmlLiteral = <See [OGC-SFOLECOM] representation for a MultiPolygon, as modified below>

In Ellipsoidal coordinates, all rings are equally interpretable as "outer". Therefore, the rings have to have their control points in left-foot winding order. This means that the points to the left side of the ring, when traversing in serialized order, are in the polygon, while those to the right side are not.

In planar coordinates, where "outer" is well defined, the first ring has to be the outer ring, in accordance with the GML standard.

Edm.Geometry

N/A

N/A

Edm.GeometryPoint

pointGmlLiteral

N/A

Edm.GeometryLineString

lineStringGmlLiteral

N/A

Edm.GeometryPolygon

polygonGmlLiteral

N/A

Edm.GeometryCollection

geoCollectionGmlLiteral

N/A

Edm.GeometryMultiPoint

multiPointGmlLiteral

N/A

Edm.GeometryMultiLineString

multiLineStringGmlLiteral

N/A

Edm.GeometryMultiPolygon

multiPolygonGmlLiteral

N/A

Table: EDM Primitive Type Formats for XML Element Values