This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]