[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] [Saxon] <xsl:choose> inside <xsl:attribute-set>
First, I would like to thank Nikolai Grigoriev and Sebastian Rahtz for their very helpful answers to my question about using CSS to emulate FO. I am now woking at outputting CSS enriched HTML as Sebastian suggested. I have a problem wich looks very much like a bug in Saxon. I am using Saxon 5.4.1. - - - toto.xsl - - - <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:attribute-set name="foo"> <xsl:attribute name="bar"> <xsl:choose> <xsl:when test="/toto">Toto</xsl:when> <xsl:otherwise>Not Toto</xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:attribute-set> <xsl:template match="/"> <toto xsl:use-attribute-set="foo"/> </xsl:template> </xsl:stylesheet> - - - - - - - - - - $ java com.icl.saxon.StyleSheet toto.xml toto.xsl Failed to compile style sheet At xsl:choose on line 8 of file:/home/david/tmp/toto.xsl: Element must only be used within a template - - - XSLT Programmer's Reference (p. 164) - - - An attribute set in not simply a textual macro. The attributes contained in the attribute set each have a template body to define the value, and although this will often be a simple text node, it may also, for example, declare variables or invoke other XSLT instructions such as <xsl:call-template> and <xsl:apply-templates>. - - - - - - - - - - - - - - - - - - - - - - - - - Is there actually a contradiction, or a I am misunderstanding something ? Actually, I can work around the problem by using named templates instead of attribute sets, but using attribute sets gives a useful clue to the human reader (I am working on an semi-automated conversion tool). Moreover this upsets me as a wrongness in my grokking of XSLT. -- David -- PS: Kay's book is the One True Book (tm) on XSLT XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|