spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column37

Dynamic Web Sites with XML, XSLT and JSP

Technical Lead
Thomson Reuters (Markets) LLC
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?


Example

The link between the JSP and the XSLT stylesheet is the data. We defined a phonebook format in XML like so, and saved it under xslt/xml/book.xml:

<book>
	<phone>
		<name>Police</name>
		<number>110</number>
	</phone>
	<phone>
		<name>Fire Brigade</name>
		<number>112</number>
	</phone>
</book>

The following minimalist JSP will be used as a data source under xslt/book.jsp:

<%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl"%>
<html>
<head><title>Phone Book</title></head>
<body>
<xsl:InsertWithXSL xml="/xml/book.xml" xsl="/xml/book.xsl" />
</body>
</html>

The first line references the xsl taglib, and the xsl:InsertWithXSL directive invokes the XSLT processor and gets replaced with the resulting application of book.xsl on book.xml.

After the programmer's contributions comes the designer's work.

Produced by Michael Claßen

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

URL: http://www.webreference.com/xml/column37/3.html
Created: Aug 15, 2001
Revised: Aug 15, 2001