# OpenLayers.Format.SLD

Read/Wite SLD. Create a new instance with the OpenLayers.Format.SLD constructor.

#### Inherits from

- OpenLayers.Format.XML.VersionedOGC

Summary

OpenLayers.Format.SLD | Read/Wite SLD.
Properties |
defaultVersion | {String} Version number to assume if none found.
stringifyOutput | {Boolean} If true, write will return a string otherwise a DOMElement.
namedLayersAsArray | {Boolean} Generate a namedLayers array.
Functions |
write | Write a SLD document given a list of styles.
read | Read and SLD doc and return an object representing the SLD.

### Properties

### defaultVersion

{String} Version number to assume if none found. Default is “1.0.0”.

### stringifyOutput

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

### namedLayersAsArray

{Boolean} Generate a namedLayers array. If false, the namedLayers property value will be an object keyed by layer name. Default is false.

### Functions

### write

Write a SLD document given a list of styles.

#### Parameters

sld | {Object} An object representing the SLD.
options | {Object} Optional configuration object.

#### Returns

{String} An SLD document string.

### read

Read and SLD doc and return an object representing the SLD.

#### Parameters

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

#### Returns

{Object} An object representing the SLD.

Read/Wite SLD.
Base class for versioned formats, i.e.
Close