W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2004

xslt question

From: Karen Smith <KSmith@kevric.com>
Date: Thu, 24 Jun 2004 16:08:32 -0400
Message-ID: <6D876AD43A7AB2458A09FF20612AB033A447A2@exmail1.kevric.com>
To: <xmlschema-dev@w3.org>

Hello all,

I am new to XSLT and I am trying to get an output that returns all of
the repeated elements rather than just the first one.  So for the
example below I would like it to return both restaurant names and right
now it is only returning the first one.  If anyone can help me I would
greatly appreciate it.  Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

Here is my stylesheet:
	<xsl:template match="/">
			<table cellpadding="2">
			<tbody><xsl:for-each select="food/italian">
			 <tr><td><xsl:value-of select="pizza"/> </td>
<td><xsl:value-of select="sauce"/></td><td> <xsl:copy-of
select="garlic"/></td> <td><xsl:value-of select="restaurant"/></td></tr>

And here is the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="generic.xsl"?>
		<pizza>12 inch</pizza>
		<garlic>3 cloves</garlic>
		<restaurant>mamma mia</restaurant>
		<restaurant>italian gardens</restaurant>

Karen L. Smith
Data Conversion Specialist
The Kevric Company, Inc.
8484 Georgia Ave., Suite 550
Silver Spring, MD 20910
(301) 588-6000 x247
Fax (301)588-1777
email KSmith@kevric.com
Received on Thursday, 24 June 2004 16:09:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:05 UTC