I have this code where i’s like to traverse through all com.abc.db.ConfigInfo row, and if any of them contains cfgId as 141 alert(cfgName)
Updated
alert(xml);
$(xml).find('list com\\.abc\\.db\\.ConfigInfo').each(function()
{
alert("enter the dragon");
if($(this).find('cfgId').text()=="141")
alert($(this).find('cfgName').text());
});
My XML
<list>
<com.abc.db.ConfigInfo>
<cfgId>83</cfgId>
<cfgName>test</cfgName>
</com.abc.db.ConfigInfo>
<com.abc.db.ConfigInfo>
<cfgId>102</cfgId>
<cfgName>cfgname1</cfgName>
</com.abc.db.ConfigInfo>
</list>
Your code looks correctly to me. But in your xml example you don’t have any
cfgIdas141. And this is a good reason why you don’t get any alert…