Re: [xsl] Opera's JavaScript API for XSLT?

Subject: Re: [xsl] Opera's JavaScript API for XSLT?
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Fri, 22 Sep 2006 18:49:09 -0400
M. David Peterson wrote:
Hey Robert,

Robert Koberg wrote:
Hi,


I have added some XSL transformation conveniences to the dojo toolkit (http://dojotoolkit.org - you would need to use SVN and get the trunk)
WOW! I hadn't realized how big Dojo had become. I've got the repository checked out. Where can I find your extensions?


Dojo is pretty cool :) Docs kinda suck. The dojo.xml.XslTransform class is in: dojo/src/xml. Be sure to check out dojo/tests/xml/test_XslTransform.html for some different uses.


Basically, the public API (I am open to change or extend it to make it more useful) looks like:

dojo.xml.XslTransform = function(/*String*/ xsltUri) {
/*
Common params:
xmlDoc - the primary XML source
params - a 2 dim array, e.g. [[name, value]] which is cleared after each transform
parentDoc - the window.document that is the parent of the result
*/


this.getResultString = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*HTMLDocument*/parentDoc)

/*
contentPane - dojo specific layout region to put the result into (instatiates child widgets)
*/
this.transformToContentPane = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*ContentPane*/contentPane, /*HTMLDocument*/parentDoc);


/*
region - some HTML element to put the result into
*/
this.transformToRegion = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*HTMLElement*/region, /*HTMLDocument*/parentDoc);


this.transformToDocument = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params);

this.transformToWindow = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*HTMLDocument*/windowDoc, /*HTMLDocument*/parentDoc);

}

best,
-Rob

Current Thread