[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] can't get xsl:sort to work


Subject: [xsl] can't get xsl:sort to work
From: UlyLee <ulyleeka@xxxxxxxxx>
Date: Mon, 19 Sep 2005 03:58:08 -0700 (PDT)

hello!

i'm working on an xml file that needs to convert into
a table (html format). and i have this xsl coding:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0"
encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
<table cellspacing="10">
<thead>
<tr align="left">
<th>Col. 1</th>
<th>Col. 2</th>
<th>Col. 3</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="//complexarticle |
//simplearticle | //dummyarticle">
<xsl:sort select="@entry">
<tr valign="top">
<td><xsl:value-of select="@id"/></td>
<td><xsl:value-of select="@entry"/></td>
<td><xsl:variable name="x" select="count(.//xref)"/>
<xsl:for-each select=".//xref">
<xsl:value-of select="."/>
<xsl:if test="position() &lt; $x">
<br/>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:sort>
</xsl:for-each>
</tbody>
</table>
</xsl:template>

</xsl:stylesheet>

i'm using version 2.0 coz i need to output multiple
files. but when i run the transformation (i'm using
xmlspy) i get and error "Expected select attribute or
non empty content not both" but i have a select
attribute. what's wrong with my xsl file.

UlyLee



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


Current Thread
Keywords