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

RE: Xalan-Java extensions

Subject: RE: Xalan-Java extensions
From: Zeynep Gunal <z.gunal@xxxxxxxxxxxxxxxx>
Date: Fri, 23 Mar 2001 09:20:31 +0100
gunal
Chris,

Thanks for trying.

Having had already written (with Jeni's help) a mini embedded javascript, I
first tried <lxslt:component> <lsxslt:script lang=javascript> combination to
solve this problem too, but my understanding is that file I/O operations are
not supported by javascript.

Replacing javascript with JScript did not help, either.

Cheers,

Zeynep



-----Original Message-----
From: Chris Bayes [mailto:Chris@xxxxxxxxxxx]
Sent: Wednesday, March 21, 2001 9:11 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Xalan-Java extensions


This is a step closer

<?xml version="1.0"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:mynamespace="extl"
    xmlns:lxslt="http://xml.apache.org/xslt"
    extension-element-prefixes="mynamespace"
    exclude-result-prefixes="mynamespace">

<lxslt:component prefix="mynamespace" elements="appendtolog"
functions="appendtolog">
<lxslt:script lang="javascript">
function appendtolog(){
   var fso, tf, a, ForAppending;
   ForAppending = 8;
   logString = "Testing..";
   logFileName = "c:\\testlog.txt";
   fso = new ActiveXObject("Scripting.FileSystemObject");
   if (fso.FileExists(logFileName))
      tf = fso.OpenTextFile(logFileName, ForAppending, false);
   else
      tf = fso.CreateTextFile(logFileName, true);
   // Write the input string with a newline character.
   tf.WriteLine(logString) ;
   tf.Close();
}
</lxslt:script>
</lxslt:component>
<xsl:template name="append-to-log">
<xsl:param name="log-string" select="." />
====++ <xsl:value-of select="mynamespace:appendtolog()" />
</xsl:template>

</xsl:stylesheet>

But I get
========= Parsing file:C:/TEMP/main.xsl ==========
Parse of file:C:/TEMP/main.xsl took 1484 milliseconds
========= Parsing main.XML ==========
Parse of main.XML took 110 milliseconds
=============================
Transforming...
Call to extension function failed: unable to load language: javascript
Call to extension function failed: unable to load language: javascript
Call to extension function failed: unable to load language: javascript

====++
====++
====++ transform took 375 milliseconds
XSLProcessor: done

Maybe it will work for you.

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


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

 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.