Subject: Re: Formatting elements
From: Gary L Peskin <garyp@xxxxxxxxxxxx>
Date: Tue, 03 Oct 2000 08:44:45 -0700
|
Stuart Wilson wrote:
>
> Hi,
> I'm new to XSL and I'm having trouble writing a stylesheet. The format of
> my
> input XML is
The following works for me:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="document">
<document>
<title><xsl:value-of select="item[@name='title']/text"/></title>
<bulletlist>
<xsl:apply-templates select="item[starts-with(@name,
'bullet')]/text"/>
</bulletlist>
</document>
</xsl:template>
<xsl:template match="text">
<bullet><xsl:value-of select="."/></bullet>
</xsl:template>
</xsl:stylesheet>
HTH,
Gary
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|