<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I have a filter setup to be used on a WMS layer. The filtered features are being placed on a vector layer. As long as the value that I pass to the filter does not contain any whitespace, the filter works fine. If the value passed to the filter contains whitespace within it, nothing is returned. I am using Firefox with Firebug to test the map, and all of the values that are passed to the filter are shown correctly in the POST command. I know the features exist, on the layer that is being filtered, that have the attribute with the value that I am using that has whitespace. Is there anything that I can do to the filter so that the whitespace doesn’t cause the search to fail? The applicable part of my code is below:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>var filter = new OpenLayers.Filter.Comparison({<o:p></o:p></p><p class=MsoNormal> type: OpenLayers.Filter.Comparison.EQUAL_TO,<o:p></o:p></p><p class=MsoNormal> property: 'myproperty',<o:p></o:p></p><p class=MsoNormal> value: ‘myvalue’<o:p></o:p></p><p class=MsoNormal> });<o:p></o:p></p><p class=MsoNormal>wfsProtocol = new OpenLayers.Protocol.WFS({<o:p></o:p></p><p class=MsoNormal> version: "1.1.0",<o:p></o:p></p><p class=MsoNormal> url: "<a href="http://myserver:8080/geoserver/mystore/wfs">http://myserver:8080/geoserver/mystore/wfs</a>",<o:p></o:p></p><p class=MsoNormal> featureType: "mylayer", //name of the geoserver layer<o:p></o:p></p><p class=MsoNormal> featureNS: "mystore", //name of the geoserver store<o:p></o:p></p><p class=MsoNormal> geometryName: "the_geom",<o:p></o:p></p><p class=MsoNormal> srsName: "EPSG:4326",<o:p></o:p></p><p class=MsoNormal> scope: strategy<o:p></o:p></p><p class=MsoNormal>});<o:p></o:p></p><p class=MsoNormal>var strategy = new OpenLayers.Strategy.Fixed();<o:p></o:p></p><p class=MsoNormal>var response = wfsProtocol.read({<o:p></o:p></p><p class=MsoNormal> filter: filter,<o:p></o:p></p><p class=MsoNormal> callback: processWFSQuery<o:p></o:p></p><p class=MsoNormal>});<o:p></o:p></p><p class=MsoNormal>function processWFSQuery(response) {<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>try {<o:p></o:p></p><p class=MsoNormal> var gmlParser = new OpenLayers.Format.GML.v3();<o:p></o:p></p><p class=MsoNormal> var features = gmlParser.read(response.priv.responseXML);<o:p></o:p></p><p class=MsoNormal> vectorLayer.destroyFeatures();<o:p></o:p></p><p class=MsoNormal> if(features.length > 0) {<o:p></o:p></p><p class=MsoNormal> for(var i = 0; i < features.length; i++) {<o:p></o:p></p><p class=MsoNormal> var feature = features[i];<o:p></o:p></p><p class=MsoNormal> feature.geometry.transform(new OpenLayers.Projection('EPSG:4326'),this.map.getProjectionObject());<o:p></o:p></p><p class=MsoNormal> vectorLayer.addFeatures(feature);<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal> layextent = vectorLayer.getDataExtent();<o:p></o:p></p><p class=MsoNormal> map.zoomToExtent(layextent);<o:p></o:p></p><p class=MsoNormal> }else {<o:p></o:p></p><p class=MsoNormal> alert("Not found!");<o:p></o:p></p><p class=MsoNormal> if (popup){<o:p></o:p></p><p class=MsoNormal> popup.destroy();<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal> } catch(e) {<o:p></o:p></p><p class=MsoNormal> alert("Error: " + e);<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any suggestions are greatly appreciated.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>