[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Data or Template Driven?

Subject: Re: Data or Template Driven?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 3 Jul 2002 16:46:34 +0100
generate a document database template
> I have done quite a bit of reading and I have noticed that there are
> two ways to transform xml. Data or Template. 

these styles are usually called push and pull (on this list at least)

>  In my xml I am showing text, textareas, hiddens, etc.
> How does one determine which direction to take when starting down this road? 

Basically if the result is to be a styled version of the input XMl
document then the push style, using templates is your friend, the basic
structure of the result is determined by the _input_.

If on the other hand the input is fairly unstructured flat file (eg just
a potentially big xml version of a database table and you want to
generate a document whose structure is determined by the stylesheet
but into which you want to "pull" odd bits of data to fill in some
values, then the pull/for-each style is your friend.

Personally I find that it is just always easier to use templates.
It saves you worrying which to do. It is easy to produce either style
of transform using templates but it is very hard to do a document driven
"push" transform only using for-each as you would have to essentially
re-implement the template matching process with a big xsl:choose testing
every possible node type.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.