[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to use <a style="{font: 10pt arial}"> in XSL?

Subject: Re: How to use <a style="{font: 10pt arial}"> in XSL? Keep getting error.
From: Joe English <jenglish@xxxxxxxxxxxxx>
Date: Tue, 06 Mar 2001 07:32:53 -0800
Re:  How to use <a style="{font: 10pt arial}"> in XSL?
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@xxxxxxxxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.