0

I have this xml document:

<subpages>
  <page.subpage>
    <title>blah</title>
  </page.subpage>
</subpages>

But when I try to loop through each page.subpage, nothing is returned.

$(xml).find("page.subpage").each(function() {
  console.log("found something!");
}

I'm guessing why nothing is returned has something to do with the period? I've tried html escaping it with &#46; but it didn't seem to work.

AdamB
  • 3,101
  • 4
  • 34
  • 44
  • possible dupe: http://stackoverflow.com/questions/350292/how-do-i-get-jquery-to-select-elements-with-a-period-in-their-id – MikeM May 24 '11 at 04:07

2 Answers2

0

What is the value of the XML selector? How are you setting that up? Try running it through with some kind of javascript debugger (firebug?) and see if you are ever even getting into the each function.

Fourth
  • 9,163
  • 1
  • 23
  • 28
0

try

$(xml).find("page\\.subpage").each(function() {
  console.log("found something!");
}
MikeM
  • 27,227
  • 4
  • 64
  • 80