[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:variable with hex color values
Michael Kay wrote:
Another solution to add to the list you've been given: In XSLT 2.0 you can do I've tried the solution you've mentioned and got "Error loading stylesheet: Parsing an XPath expression failed". Here's the XML and XSL documents I've used: <?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" href="teste.xsl"?> <tests> <test> 1 </test> <test> 2 </test> <test> 3 </test> <test> 4 </test> </tests> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes"> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <html> <head/> <body> <table> <xsl:for-each select="//test"> <tr> <td bgcolor="{if (position() mod 2) then 'black' else 'white'}"> <xsl:value-of select="."/> <br/> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> Is something wrong with this example? How can I solve the problem? Thank you for your assistance, regards, Rolando
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|