XML Format Example


Shows the use of the OpenLayers XML format class

OpenLayers has a very simple XML format class (OpenLayers.Format.XML) that can be used to read/write XML docs. The methods available on the XML format (or parser if you like) allow for reading and writing of the various XML flavors used by the library - in particular the vector data formats. It is by no means intended to be a full-fledged XML toolset. Additional methods will be added only as needed elsewhere in the library.

This page loads an XML document and demonstrates a few of the methods available in the parser.

Status: XML document loading...

After the XML document loads, see the result of a few of the methods below. Assume that you start with the following code:
var format = new OpenLayers.Format.XML();

Sample methods Output: