This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Formatting elements


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]