[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Formatting elements

Subject: RE: Formatting elements
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 3 Oct 2000 17:56:42 +0100
xsl bullet item
If the input and output are really this regular, it's easy:

<xsl:template match="/">
<document>
<xsl:apply-templates select="item[@name='title']"/>
<bulletlist>
<xsl:apply-templates select="item[starts-with(@name, 'bullet')]"/>
</bulletlist>
</document>
</xsl:template>

<xsl:template match="item[@name='title']">
<title><xsl:value-of select="."/></title>
</xsl:template>

<xsl:template match="item[starts-with(@name, 'bullet')]">
<bullet><xsl:value-of select="."/></bullet>
</xsl:template>

But of course, I'm trying to guess what the general structure of your
problem is from one example input and output, which is always dangerous.

Mike Kay

> -----Original Message-----
> From: Stuart Wilson [mailto:coracle@xxxxxxxxxxxxxx]
> Sent: 03 October 2000 12:34
> To: XSL-List@xxxxxxxxxxxxxxxx
> Subject: Formatting elements
> 
> 
> Hi,
>    I'm new to XSL and I'm having trouble writing a 
> stylesheet. The format of 
> my
> input XML is
> 
> <document>
> <item name='title'><text>Title field</text></item>
> <item name='bullet1'><text>some text for item 1</text></item>
> <item name='bullet2'><text>some text for item 2</text></item>
> <item name='bullet3'><text/></item>
> <item name='bullet4'><text/></item>
> <item name='bullet5'><text/></item>
> <item name='bullet6'><text/></item>
> ...
> <item name='bulletn'><text/></item>
> </document>
> 
> I'm trying to get my stylesheet to output
> 
> <document>
> <title>Title field</title>
> <bulletlist>
>    <bullet>some text for item 1</bullet>
>    <bullet>some text for item 2</bullet>
>    <bullet></bullet>
>    <bullet></bullet>
>    <bullet></bullet>
>    ...
> </bulletlist>
> </document>
> 
> I have managed to generate to new tags from the name 
> attribute but cannot
> get the <bulletlist> element generated. Can anyone help?
> 
> Thanks in advance,
> 
> Stuart
> 
> 
> 
> Totalise - the Users ISP
> ----------------------
> To become a member and a shareholder
> visit http://www.totalise.net
> 
> -------------------------------------------
> Free SMS messaging ---> http://sms.totalise.net
> 
> Send Flowers ---> http://www.flowers2send.com
> -------------------------------------------
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.