Hi Hugh,

Am 20.03.2008 um 17:14 schrieb Hugh Gibson:
> qx.xml.Document.fromString is able to parse XML and give a document  
> node
> that can be searched with xpath, nodes modified, and re-serialized  
> etc.
[snip]

Why not let the browser parse the code? Just do something like this:

var container = document.createElement("div");
container.innerHTML = yourHTMLCode;

You can then traverse the DOM of the container as usual (e.g.  
container.getElementsByTagName("img") or with solutions like 
http://coderepos.org/share/wiki/JavaScript-XPath) 
. I think using innerHTML is the fastest way to parse HTML. Since you  
don't have to add the container element to the document, you can parse  
complete documents (including <html></html>) without affecting the  
current page.

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

Reply via email to