Deprecated XML.js method.
This commit is contained in:
@@ -1702,3 +1702,45 @@ OpenLayers.Control.MouseToolbar = OpenLayers.Class(
|
||||
OpenLayers.Control.MouseToolbar.X = 6;
|
||||
OpenLayers.Control.MouseToolbar.Y = 300;
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Format.XML
|
||||
*/
|
||||
OpenLayers.Util.extend(OpenLayers.Format.XML.prototype, {
|
||||
|
||||
/**
|
||||
* APIMethod: concatChildValues
|
||||
* *Deprecated*. Use <getChildValue> instead.
|
||||
*
|
||||
* Concatenate the value of all child nodes if any exist, or return an
|
||||
* optional default string. Returns an empty string if no children
|
||||
* exist and no default value is supplied. Not optimized for large
|
||||
* numbers of child nodes.
|
||||
*
|
||||
* Parameters:
|
||||
* node - {DOMElement} The element used to look for child values.
|
||||
* def - {String} Optional string to return in the event that no
|
||||
* child exist.
|
||||
*
|
||||
* Returns:
|
||||
* {String} The concatenated value of all child nodes of the given node.
|
||||
*/
|
||||
concatChildValues: function(node, def) {
|
||||
var value = "";
|
||||
var child = node.firstChild;
|
||||
var childValue;
|
||||
while(child) {
|
||||
childValue = child.nodeValue;
|
||||
if(childValue) {
|
||||
value += childValue;
|
||||
}
|
||||
child = child.nextSibling;
|
||||
}
|
||||
if(value == "" && def != undefined) {
|
||||
value = def;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user