Making it so format.getChildValue concatenates all simple content (except for GeoRSS format). Use getChildValue instead of concatChildValues. Adding a number of other format methods for those who do manual dom traversal. Original patch from dparker. r=me (see #1846)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9180 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-04-03 19:17:49 +00:00
parent e1b1c814de
commit d1898d1a7d
6 changed files with 407 additions and 11 deletions
+3 -3
View File
@@ -726,7 +726,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
"coordinates");
var line = null;
if(nodeList.length > 0) {
var coordString = this.concatChildValues(nodeList[0]);
var coordString = this.getChildValue(nodeList[0]);
coordString = coordString.replace(this.regExes.trimSpace,
"");
@@ -897,11 +897,11 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
var ed = {};
var valueNode = data.getElementsByTagName("value");
if (valueNode.length) {
ed['value'] = this.concatChildValues(valueNode[0]);
ed['value'] = this.getChildValue(valueNode[0]);
}
var nameNode = data.getElementsByTagName("displayName");
if (nameNode.length) {
ed['displayName'] = this.concatChildValues(nameNode[0]);
ed['displayName'] = this.getChildValue(nameNode[0]);
}
attributes[key] = ed;
}