Subject: Re: [xsl] XSL month sorting (chronologically) From: "murli bk" <bkmurali@xxxxxxxxxxx> Date: Fri, 12 Apr 2002 13:13:19 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <HTML> <HEAD> <TITLE> <xsl:for-each select="eventlog"> </xsl:for-each> MURALI'S MAGIC </TITLE> </HEAD>
<H3 ALIGN="CENTRE"> EventLog Information </H3>
<xsl:for-each select="eventlog"> <TABLE border="1">
<THEAD> <TR> <TH>Date</TH> <TH>Data</TH> </TR> </THEAD>
<TR> <TD><xsl:value-of select="date"/></TD> <TD><xsl:value-of select="data"/></TD> </TR>
</HTML> </xsl:template> </xsl:stylesheet>
Thanks, Murali.
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Reply-To: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> To: "murli bk" <bkmurali@xxxxxxxxxxx> CC: XSL-List@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] XSL month sorting (chronologically) Date: Fri, 12 Apr 2002 13:35:13 +0100
Hi Murali,
> I tried out Michael's suggestion using string-length. I am getting > "Whitespace required before attributes" exception. What could be the > problem.
Your stylesheet isn't well-formed. You're using double quotes inside an attribute value that is delimited by double quotes:
> <xsl:sort
> select="string-length(substring-before("JanFebMarAprMayJunJulAugSepOctNovDec",
> substring("date",4,3))" data-type="number" />
If you use double quotes to delimit your attribute values, it's best to use single quotes to delimit XPath strings within those attributes:
<xsl:sort
select="string-length(substring-before('JanFebMarAprMayJunJulAugSepOctNovDec',
substring('date',4,3))" data-type="number" />
You can find the location of this kind of error very simply, using any XML parser. For example, simply opening the stylesheet in Internet Explorer will pinpoint the error for you.
Cheers,
Jeni
--- Jeni Tennison http://www.jenitennison.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XSL month sorting (chrono, Michael Kay | Thread | Re: [xsl] XSL month sorting (chrono, Jeni Tennison |
Re: [xsl] Netscape XSL and ' charct, Thomas B. Passin | Date | [xsl] numbering nodes (by context |, Fries, Markus, fiscu |
Month |