[texworks] QT-script and XML?

Paul A Norman paul.a.norman at gmail.com
Sat Jan 16 07:03:51 CET 2010

Dear Jonathan,

To explain what i am thinking of - is running html through htmlTidy to
get xhtml, and then running that through a QTScript to bring portions
of html into the editor as preformed LaTeX.

Walking the xml DOM also gives access to any embedded style information.

At least in windows html can be copied to the clipboard (from a
browser display window) and then processed from the clipboard into an
application as preprocessed html tags.
So  - have we got clipboard access of any sort at all please in
TeXWorks QTScript?

Else wise I can do that by preprocessing xhtml externally and bringing
it in preprocessed as normal, but i thought this might give something
useful to a wider group of people.

Thanks, Paul

2010/1/16 Paul A Norman <paul.a.norman at gmail.com>:
> Dear Jonathan,
> Thanks for getting back.
> ">I have no idea, but my guess is that it's unlikely. (Does the Qt
> documentation say anything about it?)"
> I was asking about these things  after readng the materials in the
> links you provided:
> JavaScript: The Definitive Guide ( -
> http://www.davidflanagan.com/javascript5/) has a chapter on xml ,
> "Chapter 21: JavaScript and XML", but I guessed it was assuming that
> the host applicaton (in the book's case a browser) is providing an XML
> DOM, properties and functions.
> And the ECMAScript reference  pointed to has a lot about JSON (51 hits)
> But the Qt ECMAScript reference has none, but a link from there to
> "objects, functions and properties supported by QtScript", has the
> briefiest singular mention of JSON under serialisation. "The arguments
> object can be serialized (e.g., with JSON) and transferred to another
> entity (e.g., a script engine running in another thread), where the
> object can be deserialized and passed as argument to another script
> function."
> I'll try for JSON in some exercises, if it is there it would be very
> useful, and otherwise XML sounds like far too much work to implement,
> unles the QT xml parser can expose its objects and methods directly to
> QTScript (I'm probaly wrongly thinking along the ActiveX model lines)?
> Thanks again,
> paul
> 2010/1/16 Jonathan Kew <jfkthame at googlemail.com>:
>> On 13 Jan 2010, at 10:46, Paul A Norman wrote:
>>> Dear Jonathan,
>>> After Looking thorugh
>>> http://code.google.com/p/texworks/wiki/ScriptingTeXworks and the
>>> reference links provided there, I was wanting to ask please what other
>>> modules might be added in with the QTScript in TeXWorks and
>>> specifically if an XML  object is available or  XML parsing is
>>> possible, or any form of XSL processing or XPATH?
>> Qt has an XML parser, so in principle I suppose we could try to make that available to script, but offhand I think it would take some fairly extensive work to design a suitable interface.... Do you have any ideas about what you'd expect this to look like from a script-language point of view?
>>> Or in the alternative is JSON from the ECMA specification implemented please?
>> I have no idea, but my guess is that it's unlikely. (Does the Qt documentation say anything about it?)
>> JK

More information about the texworks mailing list