Hi Hugh, Am 20.03.2008 um 19:13 schrieb Hugh Gibson: >> Why not let the browser parse the code? Just do something like this: >> >> var container = document.createElement("div"); >> container.innerHTML = yourHTMLCode; > > Thanks, I had just about got there as well. Lots of reading in > "Javascript: The Definitive Guide". > >> You can then traverse the DOM of the container as usual (e.g. >> container.getElementsByTagName("img") > > That's the detail I was missing.
Hmm, some more testing shows that this method is problematic in your use case. A lot of stuff is filtered out when using innerHTML, including <html>, <head>, and <body>. While you can easily parse HTML this way, it won't work for complete document roundtrips. I don't know if you can live with that. Regards, Andreas ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel