|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Apply-templates - how to omit top level element ta
> Yes, but in C, calls to functions are explicit; in XSLT, calls to > templates are implicit. That makes all the difference. nodes in the input are explict. Having a node <foo/> in the input causes a template matching foo to be invoked. If more than one template matches there is a resolution mechanism but it's not much less explicit than similar constructs in other languages. what you call fragility is in fact the main design feature of xslt (and most other document-oriented processing languages that came before it, dsssl, omnimark, latex, ....) It's what allows you to write code that can simply process natural language markup in which essentially arbitrary structures appear in arbitrary order. Processing flow is controlled _by the document_ not by the stylesheet. XSLT2 adds a lot more strict typing controls than xslt1 but this basic procesing model is still there. It sounds like you'd rather have a language in which the document was essentially input data not the main process control, and that process flow was under the control of the stylesheet, so you can see what is called when by looking at calls in the stylesheet rather than by looking at the document. That's fine XSLT can support that style as well, just don't use xsl:apply-templates, just named templates and call-template (and xsl:for-each. This works well for regularly structured input such as an xml view of a database, and is more or less (baring surface syntax) the definition of Xquery, for exanple. It would make converting (say) docbook to html much much more difficult. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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








