
On Fri, Dec 03, 2004 at 03:36:36PM -0500, Joshua Hutchinson wrote:
Anyone have a link to w3m in a windows executable (command line is fine, I just don't have access to a way to compile the source where I'm at right now)? This definitely looks interesting.
A friend of mine competent in Windows stuff suggests to use the following: ==== xml2txt.js ==== var x = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); x.load(WScript.Arguments(0)); var p = x.documentElement.selectNodes("//p"); for (var it = new Enumerator(p) ; !it.atEnd() ; it.moveNext()) { var t = it.item().text.replace(/\s+/, " "); if (t.charAt(0) == " ") t = t.slice(1); var l = t.length; var i = 0; var j = 0; while (i < l) { j = i + 77; if (j <= l) { j = t.lastIndexOf(" ", j); if (j < i) { j = t.indexOf(" ", i); if (j == -1) j = l; }; } else { j = l; }; WScript.Echo(t.slice(i, j)); i = j + 1; }; WScript.Echo(""); }; WScript.Quit(0); ==================== Run it with the following command: -=-=-= cscript //nologo xml2txt.js ton_fichier.xml -=-=-= With the paragraphs in the XML marked as <p></p> (Cf the selectNodes call).