michael@0: michael@0: michael@0: michael@0: michael@0: The Book michael@0: michael@0: Chapter 1. michael@0: Yada yada yada. michael@0: michael@0: michael@0: "); michael@0: michael@0: // get the children michael@0: var children = node.childNodes; michael@0: var length = children.length; michael@0: var count = 0; michael@0: while(count < length) { michael@0: child = children[count]; michael@0: list(child); michael@0: count++; michael@0: } michael@0: dump(""); michael@0: } michael@0: else { michael@0: // close tag michael@0: dump("/>"); michael@0: } michael@0: michael@0: michael@0: } michael@0: // if it's a piece of text just dump the text michael@0: else if (type == Node.TEXT_NODE) { michael@0: dump(node.data); michael@0: } michael@0: } michael@0: michael@0: list(document.documentElement); michael@0: dump("\n"); michael@0: ]]> michael@0: michael@0: