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

RE: CONTEST: How to implement "templates"? ;-)

Subject: RE: CONTEST: How to implement "templates"? ;-)
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 9 Sep 2002 09:36:34 +0100
contest how to
> Here is a contest for those with too much time (you can
> only win the honor to be the one who came up with the
> best solution ;-):
> 
> How can one implement "templates" with XSLT?
> 
> Explanation:
> 
> I have a XML file data.xml which contains lots of useful info:
> 
>     <root>
> 	<info id="info1">
> 	    <title>This is the title of info1</title>
> 	    ...
> 	</info>
> 	<info id="info2">
> 	    ...
> 	</info>
> 	...
>     </root>
> 
> Then I have a file layout.xml which descibes the layout of the
> result:
> 
>     <layout>
>     <html>
>     <head>
> 	<title><put-title-here/></title>
>     </head>
>     <body>
> 	...
>     </body>
>     </html>
>     </layout>
> 
> And now the task: Write an XSLT script which creates one
> HTML page for every /root/info element in data.xml and
> uses the layout from layout.xml. Or to put it a different
> way: How can I control how the XSLT processor processes one 
> file from another XML file?
> 
The best solution to this, in my view, is to write a stylesheet that
converts layout.xml into an XSLT stylesheet, and then applies that
stylesheet to data.xml.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx  


 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.