[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

Subject: Re: Apply-templates - how to omit top level element tags?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 10 Sep 2005 00:25:56 +0100
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
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.