Re: OpenXML/XSL:P some problem

Subject: Re: OpenXML/XSL:P some problem
From: "Garriss Jr.,James P." <jgarriss@xxxxxxxxx>
Date: Fri, 15 Oct 1999 09:21:41 -0400
At 06:12 AM 10/15/99 , Alexandre Trusch wrote:
>Hello, I use XSL/XML only since one week. I have th folllowing problem :
>
>1) It seems impossible to create this kind of link with XSL:P
>2) How can I add script in the XSL file (All the &,<,... are replaced  by
>&amp;,...). My goal is to create an HTML file with a Javascript section in
>it.

XSL:P currently uses the Apr99 spec and therefore supports extension functions. I suggest that you look at the spec for starters. Here's an example:

****

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";
  xmlns:jpg=""
  result-ns="text"
  default-space="strip">

<xsl:functions ns="jpg" type="text/javascript">
<![CDATA[

var intLength = 0;

function fcnResetLength()
{
  intLength = 0;
  return;
}

]]>
</xsl:functions>

<!-- root -->
<xsl:template match="/">
  <foo>
  <xsl:apply-templates select="*"/>
  </foo>
</xsl:template>

<!-- linear sets -->
<xsl:template match="*[@settype='linear']">
  <xsl:text>&#xD;&#xA;</xsl:text>
  <xsl:variable name="hokey1" expr="jpg:fcnResetLength()"/>
</xsl:template>

</xsl:stylesheet>

*******

Note that I have had some problems getting extension functions to work, having to do with the ECMAScript handler that is used. Keith is looking into fixing this problem, perhaps by adding support for JPython.


James Garriss | The MITRE Corporation | jgarriss @ mitre.org



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



Current Thread