|
From: Pennell, D. <DPe...@qu...> - 2003-10-15 12:55:33
|
> There are so many ways to do this? What did you have in mind? > (ie: what did you mean by 'both modes') Disclaimer - its been a while since I looked at XSLT, quite a while. IIRC, XSLT supports a mode where your template drives the transformation and you "pull" from the source DOM and another mode where you navigate the source DOM and explicitly construct the output DOM. In the first mode, it would be handy to be able to use JS to: - map input tags/values to output tags/values - conditionally create output leaves of the output In the second mode, being able to use JS seems even more compelling - its is procedural by nature and the JS interface to the XML DOM should be pretty expressive and terse. BTW - my first project at work that's using Smee uses an approach very similar to the first mode. The input is one or more streams of records/fields and the output is a domain specific object tree. You define the input schema(s) and define a template for the output. You use JS to define filters, conditional object creation and object attribute expressions. As each new record arrives, it fires the template with a record in the form of a JS object. |