// get the lyrics page. Rhino readUrl() method is particularly // convenient. var rawLyrics = readUrl("http://99-bottles-of-beer.net/lyrics.html"); // the html lyrics page (http://99-bottles-of-beer.net/lyrics.html) // is not well-formed, so we have to replace
with
var wellFormedRawLyrics = rawLyrics.replace(/
/gi, "
"); var xmlLyrics = new XML(wellFormedRawLyrics); // set the default namespace for convenience--don't hardcode default xml namespace