I think the most appropriate way for Thunderbird would be to distribute transformiix as an extension (Hopefully maintained by the Mozilla team).
To get the ball rolling, I thought I'd attempt to install transformiix in Thunderbird myself.
As a first step I have tried using the transformiix.so file from Mozilla 1.8a. This works to a degree, being able to create transformiix classes, with a few idiosyncrasies, but crashes when try to evaluate an XPath.
So this raises the following questions:
1. Should it be possible to simply use transformiix.so from a Mozilla version, and have it run on Thunderbird?
If so, what am I doing wrong?
2. If transformiix from Mozilla cannot be used, then how should transformiix be built to provide compatible components to Thunderbird?
3. Are there any other components in addition to transformiix.so that might allow it to work without crashing?
***** Test code follows ***** // This code was run by hand at the console in the venkman debugger. // It is presented in script form for readability only.
var xslt = Components.classes["@mozilla.org/document-transformer;1?type=xslt"].getService();
var xpathEval = Components.classes["@mozilla.org/transformiix-domci-extender;1"].getService();
// The 2 above sometimes generate the following error:
// Component returned failure code: 0x80570016
// (NS_ERROR_XPC_GS_RETURNED_FAILURE)
// They can usually be repeated, and succeed.
// If the above 2 aren't done, then the creation of XPathEvaluator will
//sometimes fail with a no factory error.
var eval2 = new XPathEvaluator;
var contentDocument = document.getElementById("messagepane").contentDocument;
// The following statement crashes Thunderbird.
// The following also crashes when run on document.evaluate() or
// contentDocument.evaluate()
var result = eval2.evaluate("/HTML/BODY",contentDocument,null,XPathResult.ANY_TYPE,null);
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom
