I would like to parse my variable "valueStations2" into a xml string. Instead of a static sos:FeatureOfInterestId value (here e.g. "stationname") I would like to have a dynamic parsed from javascript. I tried setting my variable in quotes like "valueStation2" for "stationname" but xml does not except. I would like to know how to add a variable to xml. Any suggestions?
var valueStation2;
var xml = "<?xml version='1.0' encoding='UTF-8'?>
<sos:GetFeatureOfInterestTime
xmlns:sos='http://ift.tt/1xt0Rqo'
service='SOS' version='1.0.0'
xmlns:ows='http://ift.tt/1r1HZSR'>
<sos:FeatureOfInterestId>stationname</sos:FeatureOfInterestId>
</sos:GetFeatureOfInterestTime>";
// create handler
var request = OpenLayers.Request.POST({
url: "http://ift.tt/1r1I2hx",
data: xml,
callback: handler
});
No comments:
Post a Comment