2 * @requires OpenLayers/Format/WFSCapabilities.js
6 * Class: OpenLayers.Format.WFSCapabilities.v1
7 * Abstract class not to be instantiated directly.
10 * - <OpenLayers.Format.XML>
12 OpenLayers.Format.WFSCapabilities.v1 = OpenLayers.Class(
13 OpenLayers.Format.WFSCapabilities, {
16 * Constructor: OpenLayers.Format.WFSCapabilities.v1_1
17 * Create an instance of one of the subclasses.
20 * options - {Object} An optional object whose properties will be set on
23 initialize: function(options) {
24 OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
25 this.options = options;
30 * Read capabilities data from a string, and return a list of layers.
33 * data - {String} or {DOMElement} data to read/parse.
36 * {Array} List of named layers.
38 read: function(data) {
39 if(typeof data == "string") {
40 data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
42 var capabilities = {};
43 var root = data.documentElement;
44 this.runChildNodes(capabilities, root);
49 * Method: runChildNodes
51 runChildNodes: function(obj, node) {
52 var children = node.childNodes;
53 var childNode, processor;
54 for(var i=0; i<children.length; ++i) {
55 childNode = children[i];
56 if(childNode.nodeType == 1) {
57 processor = this["read_cap_" + childNode.nodeName];
59 processor.apply(this, [obj, childNode]);
66 * Method: read_cap_FeatureTypeList
68 read_cap_FeatureTypeList: function(request, node) {
69 var featureTypeList = {
72 this.runChildNodes(featureTypeList, node);
73 request.featureTypeList = featureTypeList;
77 * Method: read_cap_FeatureType
79 read_cap_FeatureType: function(featureTypeList, node, parentLayer) {
81 this.runChildNodes(featureType, node);
82 featureTypeList.featureTypes.push(featureType);
86 * Method: read_cap_Name
88 read_cap_Name: function(obj, node) {
89 var name = this.getChildValue(node);
96 * Method: read_cap_Title
98 read_cap_Title: function(obj, node) {
99 var title = this.getChildValue(node);
106 * Method: read_cap_Abstract
108 read_cap_Abstract: function(obj, node) {
109 var abst = this.getChildValue(node);
111 obj["abstract"] = abst;
115 CLASS_NAME: "OpenLayers.Format.WFSCapabilities.v1"