code: function(node, ring) {
              var nodeList = this.getElementsByTagNameNS(node, this.internalns,
                                                         "coordinates");
              var line = null;
              if(nodeList.length > 0) {
                  var coordString = this.getChildValue(nodeList[0]);
  
                  coordString = coordString.replace(this.regExes.trimSpace,
                                                    "");
                  coordString = coordString.replace(this.regExes.trimComma,
                                                    ",");
                  var pointList = coordString.split(this.regExes.splitSpace);
                  var numPoints = pointList.length;
                  var points = new Array(numPoints);
                  var coords, numCoords;
                  for(var i=0; i<numPoints; ++i) {
                      coords = pointList[i].split(",");
                      numCoords = coords.length;
                      if(numCoords > 1) {
                          if(coords.length == 2) {
                              coords[2] = null;
                          }
                          points[i] = new OpenLayers.Geometry.Point(coords[0],
                                                                    coords[1],
                                                                    coords[2]);
                      } else {
                          throw "Bad LineString point coordinates: " +
                                pointList[i];
                      }
                  }
                  if(numPoints) {
                      if(ring) {
                          line = new OpenLayers.Geometry.LinearRing(points);
                      } else {
                          line = new OpenLayers.Geometry.LineString(points);
                      }
                  } else {
                      throw "Bad LineString coordinates: " + coordString;
                  }
              }
  
              return line;
          }
docs: Method: parseGeometry.linestring
  Given a KML node representing a linestring geometry, create an
  OpenLayers linestring geometry.
  
  Parameters:
  node - {DOMElement} A KML LineString node.
  
  Returns:
  {<OpenLayers.Geometry.LineString>} A linestring geometry.