OpenLayers.Format.XML.VersionedOGC

Base class for versioned formats, i.e. a format which supports multiple versions.

To enable checking if parsing succeeded, you will need to define a property called errorProperty on the parser you want to check.  The parser will then check the returned object to see if that property is present.  If it is, it assumes the parsing was successful.  If it is not present (or is null), it will pass the document through an OGCExceptionReport parser.

If errorProperty is undefined for the parser, this error checking mechanism will be disabled.

Inherits from

Summary
OpenLayers.Format.XML.VersionedOGCBase class for versioned formats, i.e.
Properties
defaultVersion{String} Version number to assume if none found.
version{String} Specify a version string if one is known.
profile{String} If provided, use a custom profile.
allowFallback{Boolean} If a profiled parser cannot be found for the returned version, use a non-profiled parser as the fallback.
name{String} The name of this parser, this is the part of the CLASS_NAME except for “OpenLayers.Format.”
stringifyOutput{Boolean} If true, write will return a string otherwise a DOMElement.
parser{Object} Instance of the versioned parser.
Constructor
OpenLayers.Format.XML.VersionedOGC.Constructor.
Functions
getVersionReturns the version to use.
getParserGet an instance of the cached parser if available, otherwise create one.
writeWrite a document.
readRead a doc and return an object representing the document.

Properties

defaultVersion

{String} Version number to assume if none found.

version

{String} Specify a version string if one is known.

profile

{String} If provided, use a custom profile.

allowFallback

{Boolean} If a profiled parser cannot be found for the returned version, use a non-profiled parser as the fallback.  Application code using this should take into account that the return object structure might be missing the specifics of the profile.  Defaults to false.

name

{String} The name of this parser, this is the part of the CLASS_NAME except for “OpenLayers.Format.”

stringifyOutput

{Boolean} If true, write will return a string otherwise a DOMElement.  Default is false.

parser

{Object} Instance of the versioned parser.  Cached for multiple read and write calls of the same version.

Constructor

OpenLayers.Format.XML.VersionedOGC.

Constructor.

Parameters

options{Object} Optional object whose properties will be set on the object.

Functions

getVersion

getVersion: function(root,
options)

Returns the version to use.  Subclasses can override this function if a different version detection is needed.

Parameters

root{DOMElement}
options{Object} Optional configuration object.

Returns

{String} The version to use.

getParser

getParser: function(version)

Get an instance of the cached parser if available, otherwise create one.

Parameters

version{String}

Returns

{OpenLayers.Format}

write

write: function(obj,
options)

Write a document.

Parameters

obj{Object} An object representing the document.
options{Object} Optional configuration object.

Returns

{String} The document as a string

read

read: function(data,
options)

Read a doc and return an object representing the document.

Parameters

data{String | DOMElement} Data to read.
options{Object} Options for the reader.

Returns

{Object} An object representing the document.

getVersion: function(root,
options)
Returns the version to use.
getParser: function(version)
Get an instance of the cached parser if available, otherwise create one.
write: function(obj,
options)
Write a document.
read: function(data,
options)
Read a doc and return an object representing the document.
Read and write XML.
Base class for format reading/writing a variety of formats.
Close