• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. RSS: Parse Me, You Fool > How the Function Does Its Function Thing

How the Function Does Its Function Thing

  • First, we create an array that'll hold off the desired nodes.

  • Then, after making sure the RSS file even has child nodes, we assume it's valid RSS and look for <channel>.

  • We set nodeSeeker as the node we're currently looking at. Note that we're only looking at immediate children of <channel>, because, well, that's all we care about.

  • We start looping over all of the <channel>'s child nodes.

  • We look for elements with the same name as the tagName the function was handed. If it matches, we shove (okay, push) that node into our array.

  • Very important: We move nodeSeeker down to the next child of <channel>.

  • When we're done, we return the array.

  • All is well with the world.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint