Subject: RE: [Saxon] <xsl:choose> inside <xsl:attribute-set> From: "Chris Bayes" <Chris@xxxxxxxxxxx> Date: Thu, 17 Aug 2000 17:34:26 +0100 |
Do you have xml:space="preserve" in your xml? If you do you will get this error. Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml >-----Original Message----- >From: owner-xsl-list@xxxxxxxxxxxxxxxx >[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of David Allouche >Sent: 17 August 2000 19:22 >To: XSL mailing-list >Subject: [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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [Saxon] <xsl:choose> inside <xs, Gary L Peskin | Thread | Write to XML file using XSL, JaiminSoni123 |
RE: Is there a way to translate ent, Kevin Williams | Date | RE: using parameters, Chris Bayes |
Month |