|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Questioning XSL
Hi Paul,
<Comment>
You've given me only pattern matching. In JavaScript, Python or Perl I
would have to write the polymorphic dispatch engine myself and likely
write my output templates in some weird non-XML syntax:
make( "HTML" ) or write( "<HTML>" ) or something.
</Comment>
<reply>
Even if what you say is true on most script languages. It is however
possible to use these script languages differently. Take for example python
script (I know you like this language ;-). You have a version packaged as
active script. For all that think that this is Microsoft stuff and start
getting allergic reactions take Advil :-))). So, basically, this interface
(which by the way also work with minor modification as a XPCOM module) could
be called for a particular procedure or function. So, if you have a XML
parser that for each element, calls a particular procedure, you then have a
similar event driven script as you would have with the event driven language
family or pattern match family (XSL, DSSSL, etc..) then, for example, to
associate a particular procedure to a particular element:
function baba(current_node) <- baba is a XML element
your procedure body here
You can do this kind of mechanism with:
a) python
b) Perl
c) Ecma script
d) vb script
Some could be ported on different platforms (with XPCOM help) some cannot
(like VBscript for obvious reasons)
So, the constructs or rules would be more like Omnimark. A drawback compared
to XSL (the rich XSL pattern matching and functional character). An
advantage: suited for processing incoming XML documents like for e-commerce
(i.e.. the procedure body can access a data base).
The point here is that, if the script language is packaged as a component in
a certain way, a parser can be used as an even trigger that calls procedures
or functions. Simply a different possible approach possible today with some
popular script languages. You don't necessarily need to include in the
script language a loop (switch like) or a particular procedure to dispatch
the control to the right rule/procedure.
<Comment>
pattern = compilePattern( "B" )
function B_template( current_node ){
e_group(
make_element( "BOLD",
dispatch_children( current_node )))
}
xsl_engine.add( pattern, B_template )
</comment>
<Reply>
Paul, your library looks promising, nice construct.
</reply>
regards
Didier PH Martin
mailto:martind@xxxxxxxxxxxxx
http://www.netfolder.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








