diff --git a/lib/OpenLayers/Format/WCSCapabilities.js b/lib/OpenLayers/Format/WCSCapabilities.js index ae034a5227..082805602c 100644 --- a/lib/OpenLayers/Format/WCSCapabilities.js +++ b/lib/OpenLayers/Format/WCSCapabilities.js @@ -22,14 +22,6 @@ OpenLayers.Format.WCSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Versi */ defaultVersion: "1.1.0", - /** - * APIProperty: errorProperty - * {String} Which property of the returned object to check for in order to - * determine whether or not parsing has failed. In the case that the - * errorProperty is undefined on the returned object, the document will be - * run through an OGCExceptionReport parser. - */ - errorProperty: "service", /** * Constructor: OpenLayers.Format.WCSCapabilities diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js index e68b004a74..ca0799ac79 100644 --- a/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js +++ b/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js @@ -38,6 +38,16 @@ OpenLayers.Format.WCSCapabilities.v1_0_0 = OpenLayers.Class( ows: "http://www.opengis.net/ows" }, + /** + * APIProperty: errorProperty + * {String} Which property of the returned object to check for in order to + * determine whether or not parsing has failed. In the case that the + * errorProperty is undefined on the returned object, the document will be + * run through an OGCExceptionReport parser. + */ + errorProperty: "service", + + /** * Property: readers * Contains public functions, grouped by namespace prefix, that will diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js b/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js index b991bca48e..7e2061afcb 100644 --- a/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js +++ b/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js @@ -30,6 +30,15 @@ OpenLayers.Format.WCSCapabilities.v1_1_0 = OpenLayers.Class( ows: "http://www.opengis.net/ows/1.1" }, + /** + * APIProperty: errorProperty + * {String} Which property of the returned object to check for in order to + * determine whether or not parsing has failed. In the case that the + * errorProperty is undefined on the returned object, the document will be + * run through an OGCExceptionReport parser. + */ + errorProperty: "operationsMetadata", + /** * Constructor: OpenLayers.Format.WCSCapabilities.v1_1_0 diff --git a/lib/OpenLayers/Format/WFSCapabilities.js b/lib/OpenLayers/Format/WFSCapabilities.js index ec82ae984b..ba4598645b 100644 --- a/lib/OpenLayers/Format/WFSCapabilities.js +++ b/lib/OpenLayers/Format/WFSCapabilities.js @@ -21,15 +21,6 @@ OpenLayers.Format.WFSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Versi * {String} Version number to assume if none found. Default is "1.1.0". */ defaultVersion: "1.1.0", - - /** - * APIProperty: errorProperty - * {String} Which property of the returned object to check for in order to - * determine whether or not parsing has failed. In the case that the - * errorProperty is undefined on the returned object, the document will be - * run through an OGCExceptionReport parser. - */ - errorProperty: "featureTypeList", /** * Constructor: OpenLayers.Format.WFSCapabilities diff --git a/lib/OpenLayers/Format/WFSCapabilities/v1.js b/lib/OpenLayers/Format/WFSCapabilities/v1.js index bd52c61cea..65a5faa8a0 100644 --- a/lib/OpenLayers/Format/WFSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WFSCapabilities/v1.js @@ -28,6 +28,16 @@ OpenLayers.Format.WFSCapabilities.v1 = OpenLayers.Class( ows: "http://www.opengis.net/ows" }, + + /** + * APIProperty: errorProperty + * {String} Which property of the returned object to check for in order to + * determine whether or not parsing has failed. In the case that the + * errorProperty is undefined on the returned object, the document will be + * run through an OGCExceptionReport parser. + */ + errorProperty: "featureTypeList", + /** * Property: defaultPrefix */ diff --git a/lib/OpenLayers/Format/XML/VersionedOGC.js b/lib/OpenLayers/Format/XML/VersionedOGC.js index 4aceee6988..c2cb97471b 100644 --- a/lib/OpenLayers/Format/XML/VersionedOGC.js +++ b/lib/OpenLayers/Format/XML/VersionedOGC.js @@ -45,14 +45,6 @@ OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, { */ allowFallback: false, - /** - * APIProperty: errorProperty - * {String} Which property of the returned object to check for in order to - * determine whether or not parsing has failed. In the case that the - * errorProperty is undefined on the returned object, the document will be - * run through an OGCExceptionReport parser. - */ - errorProperty: null, /** * Property: name @@ -193,9 +185,13 @@ OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, { } var root = data.documentElement; var version = this.getVersion(root); - this.parser = this.getParser(version); - var obj = this.parser.read(data, options); - if (this.errorProperty !== null && obj[this.errorProperty] === undefined) { + this.parser = this.getParser(version); // Select the parser + var obj = this.parser.read(data, options); // Parse the data + + var errorProperty = this.parser.errorProperty || null; + + + if (errorProperty !== null && obj[errorProperty] === undefined) { // an error must have happened, so parse it and report back var format = new OpenLayers.Format.OGCExceptionReport(); obj.error = format.read(data); diff --git a/tests/Format/WCSCapabilities/v1.html b/tests/Format/WCSCapabilities/v1.html index ac4096b335..646ca47f3e 100644 --- a/tests/Format/WCSCapabilities/v1.html +++ b/tests/Format/WCSCapabilities/v1.html @@ -30,7 +30,6 @@ var res = parser.read(text); - debugger; t.ok(!res.error, "Parsing XML generated no errors"); t.eq(res.service.fees, "mucho dinero", "Service>Fees correctly parsed"); @@ -64,8 +63,6 @@ res = parser.read(text); -debugger; - t.ok(!res.error, "Parsing XML generated no errors"); // ft = res.featureTypeList.featureTypes;