I\'m using JQuery to parse some xml and having trouble with the line below:
$(xml).find(\"ACT:contains(\" + selectedAct + \")>SCENE\").each(function()
You could try extending the selectors... I made a demo in my blog a while back.
$.extend($.expr[':'],{
containsExact: function(a,i,m){
return $.trim(a.innerHTML.toLowerCase()) === m[3].toLowerCase();
},
containsExactCase: function(a,i,m){
return $.trim(a.innerHTML) === m[3];
},
containsRegex: function(a,i,m){
var regreg = /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})$/,
reg = regreg.exec(m[3]);
return RegExp(reg[1], reg[2]).test($.trim(a.innerHTML));
}
});
Try this:
$(xml).find("ACT > TITLE").filter(function() {
return this.firstChild.nodeValue === selectedAct;
}).siblings('SCENE').each(function() {...