 |
 |
 |
The right place for xslt questions is the xsl-list at mulberrytech.com.
In XSLT 1.0, to process both <restaurant> elements do
<xsl:for-each select="restaurant">
<td><xsl:value-of select="."/></td>
</xsl:for-each>
Michael Kay
> -----Original Message-----
> From: xmlschema-dev-request@w...
> [mailto:xmlschema-dev-request@w...] On Behalf Of Karen Smith
> Sent: 24 June 2004 21:09
> To: xmlschema-dev@w...
> Subject: xslt question
>
>
> 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"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <xsl:output method="html" version="1.0" encoding="UTF-8"
> indent="yes"/>
>
> Here is my stylesheet:
> <xsl:template match="/">
>
> <html>
> <body>
>
> <table cellpadding="2">
> <th>pizza</th>
> <th>sauce</th>
> <th>garlic</th>
> <th>restaurant</th>
> <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>
> </xsl:for-each>
> </tbody>
> </table></body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
>
> And here is the xml file:
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="generic.xsl"?>
> <food>
> <italian>
> <pizza>12 inch</pizza>
> <sauce>ragu</sauce>
> <garlic>3 cloves</garlic>
> <restaurant>mamma mia</restaurant>
> <restaurant>italian gardens</restaurant>
> </italian>
> </food>
>
>
>
> 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@k...
>
>
From nobody@w... Thu Jun 24 17:11:37 2004
Return-Path: <nobody@w...>
X-Original-To: xmlschema-
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |