OpenLayers OpenLayers

Changeset 5475

Show
Ignore:
Timestamp:
12/17/07 21:23:41 (1 year ago)
Author:
crschmidt
Message:

Safari's XMLSerializer support is broken: it doesn't export namespaces, so
the KML comes out namespaceless. Wrap the test up so that it doesn't totally
fail, and Paul is adding this to KnownIssues.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/tests/Format/test_KML.html

    r5161 r5475  
    5959        var features = format.read(kmlExpected); 
    6060        var kmlOut = format.write(features); 
     61        if (OpenLayers.Util.getBrowserName() == "safari") { 
     62            t.debug_print("Safari's XMLSerializer doesn't support XML namespaces.");  
     63            kmlExpected = kmlExpected.replace(/ xmlns[:a-z]*="[^"]*"/g, ''); 
     64        }     
    6165        t.eq(kmlOut, kmlExpected, "correctly writes an KML doc string"); 
    6266    } 
     
    8488        output = format.write(feature); 
    8589        expected = '<kml xmlns="http://earth.google.com/kml/2.0"><Folder><name>OpenLayers export</name><description>test output</description><Placemark><name>test name</name><description>No description available</description><MultiGeometry><Point><coordinates>0,1</coordinates></Point></MultiGeometry></Placemark></Folder></kml>'; 
     90        if (OpenLayers.Util.getBrowserName() == "safari") {  
     91            t.debug_print("Safari's XMLSerializer doesn't support XML namespaces.");  
     92            expected = expected.replace(/ xmlns[:a-z]*="[^"]*"/g, ''); 
     93        }     
    8694        t.eq(output, expected, "multipoint correctly written"); 
    8795         
     
    96104        output = format.write(feature); 
    97105        expected = '<kml xmlns="http://earth.google.com/kml/2.0"><Folder><name>OpenLayers export</name><description>test output</description><Placemark><name>test name</name><description>No description available</description><MultiGeometry><LineString><coordinates>1,0 0,1</coordinates></LineString></MultiGeometry></Placemark></Folder></kml>'; 
     106        if (OpenLayers.Util.getBrowserName() == "safari") { 
     107            t.debug_print("Safari's XMLSerializer doesn't support XML namespaces.");  
     108            expected = expected.replace(/ xmlns[:a-z]*="[^"]*"/g, ''); 
     109        }     
    98110        t.eq(output, expected, "multilinestring correctly written"); 
    99111 
     
    111123        output = format.write(feature); 
    112124        expected = '<kml xmlns="http://earth.google.com/kml/2.0"><Folder><name>OpenLayers export</name><description>test output</description><Placemark><name>test name</name><description>No description available</description><MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>0,0 1,0 0,1 0,0</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry></Placemark></Folder></kml>'; 
     125        if (OpenLayers.Util.getBrowserName() == "safari") { 
     126            t.debug_print("Safari's XMLSerializer doesn't support XML namespaces.");  
     127            expected = expected.replace(/ xmlns[:a-z]*="[^"]*"/g, ''); 
     128        }     
    113129        t.eq(output, expected, "multilinestring correctly written"); 
    114130