Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Newbie Question on msxsl:script [Thread Next] Re: Newbie Question on msxsl:scriptTo: NULL Date: 11/8/2006 8:30:00 AM
"Kkaa" <onlyafly@g...> wrote in message
news:1162934546.348119.276840@i......
> The following code gives me a "Reference to undeclared namespace
> prefix: 'trig'" error. Any help would be appreciated:
>
> in test.xslt:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:include href="trig.xslt"/>
> <xsl:output method="text"/>
> <xsl:value-of select="trig:cos(0.5)"/>
> </xsl:stylesheet>
>
> in trig.xslt:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> extension-element-prefixes="msxsl">
> <msxsl:script language="JavaScript" implements-prefix="trig">
> <![CDATA[
> function cos(arg){ return Math.cos(arg);}
> ]]>
> </msxsl:script>
> </xsl:stylesheet>
>
> Thanks!
>
Both files need to declare the namespace for the alias trig. E.g.:-
xmlns:trig="urn:mycompany.com:trig"
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
