|
From: Michael Lucas-S. <mic...@so...> - 2003-10-15 22:51:15
|
>> There are so many ways to do this? What did you have in mind? >> (ie: what did you mean by 'both modes') PD> Disclaimer - its been a while since I looked at XSLT, quite a while. PD> IIRC, XSLT supports a mode where your template drives the transformation and PD> you "pull" from the source DOM and another mode where you navigate the PD> source DOM and explicitly construct the output DOM. PD> In the first mode, it would be handy to be able to use JS to: PD> - map input tags/values to output tags/values PD> - conditionally create output leaves of the output I think there are two things you're suggesting here. You're suggesting that XSL be extended to have a JS mode, where the output of the function is the result of executing the JS? Then it also sounds like you want a way to define a template match using JS. I don't think this is a good idea. If you support the function idea then you can embed functions in a template match any way. Adding a function to XSL to evaluate JS should be quite easy to do. I've added a couple myself already now. PD> In the second mode, being able to use JS seems even more compelling - its is PD> procedural by nature and the JS interface to the XML DOM should be pretty PD> expressive and terse. PD> BTW - my first project at work that's using Smee uses an approach very PD> similar to the first mode. The input is one or more streams of PD> records/fields and the output is a domain specific object tree. You define PD> the input schema(s) and define a template for the output. You use JS to PD> define filters, conditional object creation and object attribute PD> expressions. As each new record arrives, it fires the template with a PD> record in the form of a JS object. PD> ------------------------------------------------------- PD> This SF.net email is sponsored by: SF.net Giveback Program. PD> SourceForge.net hosts over 70,000 Open Source Projects. PD> See the people who have HELPED US provide better services: PD> Click here: http://sourceforge.net/supporters.php PD> _______________________________________________ PD> Smee-development mailing list PD> Sme...@li... PD> https://lists.sourceforge.net/lists/listinfo/smee-development -- Michael http://www.softwarewithstyle.com mic...@so... |