var sendstr="";
sendstr="<?xml version='1.0' encoding='UTF-8' ?>" + "/n";
sendstr+="<wfs:GetFeature service='WFS' version='1.0.0'"+ "/n";
sendstr+="outputFormat='json'"+ "/n";
sendstr+="xmlns:topp='http://www.openplans.org/topp'"+"/n";
sendstr+="xmlns:wfs='http://www.opengis.net/wfs'"+ "/n";
sendstr+="xmlns:ogc='http://www.opengis.net/ogc'"+"/n";
sendstr+="xmlns:gml='http://www.opengis.net/gml'"+ "/n";
sendstr+="xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"+ "/n";
sendstr+="xsi:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd'>"+ "/n";
sendstr+="<wfs:Query typeName='topp:logicline' >"+"/n";
sendstr+="<wfs:PropertyName>the_geom</wfs:PropertyName>"+"/n";
sendstr+="<ogc:Filter>"+ "/n";
if(type==1)
{
sendstr+="<ogc:BBOX>"+"/n";
sendstr+="<ogc:PropertyName>the_geom</ogc:PropertyName>"+"/n";
sendstr+="<gml:Box srsName='http://www.opengis.net/gml/srs/epsg.xml#4326'>"+ "/n";
sendstr+="<gml:coordinates>"+ "/n";
sendstr+=str+"/n" ;
sendstr+="</gml:coordinates>"+"/n";
sendstr+="</gml:Box>"+ "/n";
sendstr+="</ogc:BBOX>"+"/n";
}
if(type==0)
{
sendstr+="<ogc:Intersects>"+"/n";
sendstr+="<ogc:PropertyName>the_geom</ogc:PropertyName>"+"/n";
sendstr+="<gml:Polygon srsName='http://www.opengis.net/gml/srs/epsg.xml#4326'>"+ "/n";
sendstr+="<gml:outerBoundaryIs>"+ "/n";
sendstr+="<gml:LinearRing>"+ "/n";
sendstr+="<gml:coordinates>"+ "/n";
sendstr+=str+"/n" ;
sendstr+="</gml:coordinates>"+"/n";
sendstr+="</gml:LinearRing>"+ "/n";
sendstr+="</gml:outerBoundaryIs>"+ "/n";
sendstr+="</gml:Polygon>"+ "/n";
sendstr+="</ogc:Intersects>"+"/n";
}
alert(str);
sendstr+="</ogc:Filter>"+ "/n";
sendstr+="</wfs:Query>"+ "/n";
sendstr+="</wfs:GetFeature>";
}
//prompt("test",sendstr);
//alert(OpenLayers.loadURL);
var sendRequest = OpenLayers.Request.POST({
url : "http://192.168.0.27:8028/geoserver/wfs",
data : sendstr,
callback : setHTML
});