[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: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Wed, 21 Mar 2001 17:45:57 -0000
extension function xalan msxsl
Gunal,
With a couple of mods I can get it working with msxsl

<?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="urn:zgunal@xxxxxxxxxxx"
    extension-element-prefixes="msxsl"
    exclude-result-prefixes="mynamespace">

<msxsl:script language="JScript"
              implements-prefix="mynamespace">
function appendtolog(){
   var fso, tf, a, ForAppending;
   ForAppending = 8;
   logString = "Testing..";
   logFileName = "c:\\temp\\testfile.txt";                    //escape \
   fso = new ActiveXObject("Scripting.FileSystemObject");

   if (fso.FileExists(logFileName))
      tf = fso.OpenTextFile(logFileName, ForAppending, false);//typo
   else 
      tf = fso.CreateTextFile(logFileName, true);

   // Write the input string with a newline character.
   tf.WriteLine(logString) ;
   tf.Close();
   return '';                                                 //return
}
</msxsl:script>

<xsl:template name="append-to-log">
<xsl:param name="log-string" select="." />
      <xsl:value-of select="mynamespace:appendtolog()" />
</xsl:template>

</xsl:stylesheet>

I can't get it to work with xalan. All I get is
========= Parsing file:C:/TEMP/main.xsl ==========
Parse of file:C:/TEMP/main.xsl took 1532 milliseconds
========= Parsing main.XML ==========
Parse of main.XML took 109 milliseconds
=============================
Transforming...
Call to extension function failed: urn:zgunal@hotmail/com
Call to extension function failed: urn:zgunal@hotmail/com
Call to extension function failed: urn:zgunal@hotmail/com

transform took 359 milliseconds
XSLProcessor: done

But at least it shows that it works in theory.

Ciao Chris

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


 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.