This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: using default params?
David Carlisle <davidc@nag.co.uk> writes:
> > the syntax
> > choose-when-/when-otherwise-/otherwise-/choose is more than a little
> > bit stupid for this...
>
> It's an XML feature.
> If you close your eyes, the syntax doesn't look so bad.
HaHa... ok. It helps. unfortunately I now do so many typing errors
that my parser gets upset...
> > this I don't understand.
> As Paul commented, your understanding wasn't helped by me messing up the
> example.
> > what if I want to do something like
> > <table bgcolor="#ff0000" border="1"> and have both overridden?
>
> <table bgcolor="#ff0000" border="1">
> <xsl:if test="@foo">
> <xsl:attribute name="bgcolor"><xsl:value-of select="@foo"/></xsl:attribute>
> </xsl:if>
> <xsl:if test="@bar">
> <xsl:attribute name="border"><xsl:value-of select="@bar"/></xsl:attribute>
> </xsl:if>
I see. this is much much better now.
> > And I don't understand this, too :-(
> > why don't you need a test for existence in this example around the
> > xsl:copy-of ?
>
> 'cause <xsl:copy-of select="@bgcolor"/> copys the nodes it selects
> and if there isn't a bgcolor attribute node, that isn't an error
> you just get the empty node set so nothing in the output.
I see. Thank you very much for your help.
Maybe I can ask you some other questions, regarding design decisions
in the XSL spec:
Is there any reason why it isn't possible to handle a RTF as a
node-set? At the moment I have to use a stupid hack, like
<xsl:param name="foo">
[something between]
</xsl:param>
<xsl:param name="foo-set" select="document('')//xsl:param[@name='foo']"/>
(modulo syntax errors here)
which seems to be mildly amusing to say the least.
Is there any reason why I can't use <xsl:call-template name="{$param}"> ??
and the same goes for use-attribute-sets: why isn't it possible to use
a computed name for this parameter ?? It seems to me that everything I
tried to use to program "dynamic jumps" is forbidden by purpose...
After an initial excitement over XSLT I'm now in the state where it
feels a bit like TeX: You can do everything (in theory), but things
tend to be very very hard to do... Why didn't they simply use a full
featured scheme or clisp for the style language...
Anyway, thanks again,
jtl
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list