xsl-list
[Top] [All Lists]

[xsl] Generate a List

2007-11-06 16:57:56
Hi,

I am trying to use the XSLT to generate something simple like a list and output it to HTML with <ul> and <li> tags.

This is my XSLT:

 <xsl:template match="head">
       <p>
          <xsl:apply-templates/>
       </p>
   </xsl:template>

<xsl:template match="list">
<xsl:value-of select="child::item"/>
</xsl:template>

My XML:

<head>Things to do</head>
<list>
<item>Wash the dog</item>
<item>Take out the trash</item>
<item>Check out books on XSLT</item>
<item>Go to the bank</item>
<item>Pay bills</item>
</list>

Output:

<p class="">Things to do</p>

Wash the dog Take out the trash Check out books on XSLT Go to the bank Pay bills
     <br>

Can anyone please tell me what is wrong with my code?

Thanks to those who can help.

Alice


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>