I was thinking more on the line of an html table.
Main Topics
Browse All TopicsI have the following xsl file placed in the code section below that I would like to display in a html table.
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Well, you want something like
<table>
<xsl:for-each select="BookSection">
<tr><td><xsl:variable name="last" select="Author-Name/Last"/
<td><xsl:variable name="last" select="Book-Name"/></td>
</tr>
</xsl:for-each>
Put all the values you want for the columns in.
I can't tell from your code what the outer section for each book xml is, but that's what you want as the for-each select value.
Then you don't use apply-templates or the xsl:template sections below.
Try this and see if it does something like what you want.
Well this works, but the problem is it puts all the records in a row. In other words, if I modify the xml within the jsp to be a little simpler I get the following from the below.
OUTPUT:
First1 Last1 First2 Last2
books.jsp
<%@ page contentType="text/xml" %><?xml version="1.0" encoding="UTF-8"?>
<Book>
<Author>
<First>
First1
</First>
<Last>
Last1
</Last>
</Author>
<Author>
<First>
First2
</First>
<Last>
Last2
</Last>
</Author>
</Book>
book.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.o
<xsl:output method="html" indent="yes" />
<html>
<head>
<title>JSTL XML Support -- Transforming</title>
</head>
<body bgcolor="#98AFC7">
<h3>Transforming an XML Document using XML tags</h3>
<table>
<xsl:for-each select="Author">
<tr>
<td><xsl:variable name="last" select="Last"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:stylesheet>
The xsl:for-each logic is pretty clear. Identify the level at which you want the data to loop, and run the for-each around it. Is it possible that you are not posting the xsl you are actually using? Because the XSL you've posted won't run in my tests.
This one works:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.o
<xsl:output method="html" indent="yes" />
<xsl:template match="/">
<html>
<head>
<title>JSTL XML Support -- Transforming</title>
</head>
<body bgcolor="#98AFC7">
<h3>Transforming an XML Document using XML tags</h3>
<table>
<xsl:for-each select="Book/Author">
<tr>
<td><xsl:variable name="last" select="Last"/><xsl:value-of
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Business Accounts
Answer for Membership
by: dravidnsrPosted on 2009-10-22 at 10:54:51ID: 25637074
Use POI API