pramodharithsa

Query data present in xml

Discussion created by pramodharithsa on Aug 13, 2012
Latest reply on Aug 13, 2012 by jeff.pace
I have list of ObjectId's present in xml
want to highlight them on map by adding a graphic layer.
How do i write a query to search this?
I had a wiered idea of doing this
foreach(oid in xml)
{
query.where="OBJECTID="+oid+" or ";
}
xml generally contains 1000 values [confused/]
var query = new esri.tasks.Query();
            query.returnGeometry = true;
            query.outFields = ["OBJECTID", "CMDTY", "DIA_IN", "RISK_SCORE", "MOD_DATE"];
            query.outSpatialReference = { "wkid": 102100 };
            query.where = "";   //How do i do this??
            var infoTemplate = new esri.InfoTemplate();
            infoTemplate.setTitle("${OBJECTID}");
            infoTemplate.setContent("<b>Comodity: </b>${CMDTY}<br/>"
                             + "<b>Internal Diameter: </b>${DIA_IN}<br/>"
                             + "<b>Risk Score: </b>${RISK_SCORE}<br/>"
                             + "<b>Last Updated on: </b>${MOD_DATE}");

            map.infoWindow.resize(245, 125);


            dojo.connect(queryTask, "onComplete", function (featureSet) {
            map.graphics.clear();
var highlightSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([0, 0, 0]), 3);
var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255, 0, 0]), 1);
var countiesGraphicsLayer = new esri.layers.GraphicsLayer();
                   for (var i = 0, il = featureSet.features.length; i < il; i++) {
                    var graphic = featureSet.features[i];
                    graphic.setSymbol(symbol);
                    graphic.setInfoTemplate(infoTemplate);

                    countiesGraphicsLayer.add(graphic);
                }
                map.addLayer(countiesGraphicsLayer);
                map.graphics.enableMouseEvents();

Outcomes