diff --git a/src/ol/format/xsdformat.js b/src/ol/format/xsdformat.js index 9d52f36d38..cf38bb5ab7 100644 --- a/src/ol/format/xsdformat.js +++ b/src/ol/format/xsdformat.js @@ -17,7 +17,16 @@ ol.format.XSD.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema'; */ ol.format.XSD.readBoolean = function(node) { var s = ol.xml.getAllTextContent(node, false); - var m = /^\s*(true|1)|(false|0)\s*$/.exec(s); + return ol.format.XSD.readBooleanString(s); +}; + + +/** + * @param {string} string String. + * @return {boolean|undefined} Boolean. + */ +ol.format.XSD.readBooleanString = function(string) { + var m = /^\s*(true|1)|(false|0)\s*$/.exec(string); if (m) { return goog.isDef(m[1]) || false; } else {