Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


JSP: Transforming the XML - Page 23

November 18, 2002

Here we'll use the XTags tag library from Jakarta, which can be downloaded freely from the Jakarta web site (http://jakarta.apache.org). The XTags library is a set of simple tags that give web designers access to powerful XML processing actions without any Java programming knowledge. Using this tag library, the JSP that transforms cd_list.xml using cd_list.xsl is extremely simple (cd_list.jsp):

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>

<xtags:parse uri="cd_list.xml" id="cdList"/>

<xtags:style xsl="cd_list.xsl" document="<%= cdList %>"/>

The following line declares that we'll be using the XTags tag library, with the "xtags" prefix:

<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>

The next line parses the XML document specified in the uri attribute (an external XML document can also be specified by using the url attribute and supplying the full URL to the document), and the final line transforms the document using the XSL stylesheet specified in the xsl attribute, and prints out the result.

ASP: Transforming the XML - Page 22
Practical XML for the Web


Up to => Home / Authoring / Languages / XML / PracticalXML




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers