This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to use <a style="{font: 10pt arial}"> in XSL? Keep getting error.
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] How to use <a style="{font: 10pt arial}"> in XSL? Keep getting error.
- From: Joe English <jenglish at flightlab dot com>
- Date: Tue, 06 Mar 2001 07:32:53 -0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
Kevin Duffey wrote:
>
> I am sure there is a good reason for why the error of "Namespace prefix font
> has not been declared" when I use the syntax of
>
> <a style="{font: 10pt arial}" href="/path/page.jsp">click</a>
If this is a literal result element in an XSLT stylesheet,
then the style="..." attribute value is interpreted as
an _attribute value template_; this means that stuff inside
curly braces is interpreted as an XPath expression and evaluated
by the XSLT processor.
That's where the error message is coming from: the XSLT processor is
trying to interpret CSS specifications as an XPath expression
(which naturally doesn't work :-)
You can escape the curly braces by doubling them up:
<a style="{{font: 10pt arial}}" href="/path/page.jsp">click</a>
See [XSLT] section 7.6.2 "Attribute Value Templates" for more details.
--Joe English
jenglish@flightlab.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list