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]
Other format: [Raw text]

literal result element as stylesheet with JavaScript?


Is there a way to include JavaScript in a 'literal result element
as stylesheet'? I tried the attached but obtain an error:

  "Namespace 'mynamespace' does not contain any functions."

I am suspecting that <msxsl:script> must be a "top-level" element
and may be impossilbe within 'literal result element as stylesheet'.

Are there any workarounds?

-------------------------------------------------------
<html xsl:version="1.0"
       xmlns="http://www.w3.org/TR/xhtml1/strict";
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
       xmlns:msxsl="urn:schemas-microsoft-com:xslt"
       xmlns:user="mynamespace">

  <msxsl:script language="javascript" implements-prefix="user">
   <![CDATA[
    function foo(arg) {
      return foo*foo;
    }
   ]]>
  </msxsl:script>

  <head>
   <title>Literal Result Element as Stylesheet</title>
  </head>
  <body>
   <xsl:value-of select="user:foo(number(tag))"/>
  </body>
</html>

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.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]