R
RC
First, let me say I couldn't find a group discuss
XML/XSLT. So I only choose the closest groups to
post this message.
Here is part of my *.xsl file
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:my-javascript-ext="my-ext1"
extension-element-prefixes="my-javascript-ext"
version="1.0">
<xalan:component prefix="my-javascript-ext" elements="whichever"
functions="hello">
<xalan:script lang="javascript">
function hello(w) {
return ("Hello " + w + "!");
}
</xalan:script>
</xalan:component>
.....
<xsl:if test="function-available('my-javascript-ext:hello')">
<xsl:value-of select="my-javascript-ext:hello('World')" />
<br></br>
</xsl:if>
.....
And this is part of my *.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<?xml-stylesheet type="text/xsl" href="http://myHostName/XML/myfile.xsl" ?>
.....
This is working greate for an XML file iff (if only if) I type
java org.apache.xalan.xslt.Process -in myfile.xml -xsl myfile.xsl
or
java org.apache.xalan.xslt.Process -in myfile.xml
That is wonderful, when I set CLASSPATH with
/usr/local/xalan/bin/xalan.jar:/usr/local/xalan/bin/bsf.jar:/usr/local/xalan/bin/js.jar
So I can make my own extension to call my JavaScript functions and/or
Java Class methods inside a XSL file with XALAN Processor.
But unfortunaely this will NOT work on Netscape, Firefox, IE browsers,
even all these browser support XML/XSLT.
Anyone has some idea how should I make Apache Project XALAN's extension
work on a browser?
Thank Q!
XML/XSLT. So I only choose the closest groups to
post this message.
Here is part of my *.xsl file
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:my-javascript-ext="my-ext1"
extension-element-prefixes="my-javascript-ext"
version="1.0">
<xalan:component prefix="my-javascript-ext" elements="whichever"
functions="hello">
<xalan:script lang="javascript">
function hello(w) {
return ("Hello " + w + "!");
}
</xalan:script>
</xalan:component>
.....
<xsl:if test="function-available('my-javascript-ext:hello')">
<xsl:value-of select="my-javascript-ext:hello('World')" />
<br></br>
</xsl:if>
.....
And this is part of my *.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<?xml-stylesheet type="text/xsl" href="http://myHostName/XML/myfile.xsl" ?>
.....
This is working greate for an XML file iff (if only if) I type
java org.apache.xalan.xslt.Process -in myfile.xml -xsl myfile.xsl
or
java org.apache.xalan.xslt.Process -in myfile.xml
That is wonderful, when I set CLASSPATH with
/usr/local/xalan/bin/xalan.jar:/usr/local/xalan/bin/bsf.jar:/usr/local/xalan/bin/js.jar
So I can make my own extension to call my JavaScript functions and/or
Java Class methods inside a XSL file with XALAN Processor.
But unfortunaely this will NOT work on Netscape, Firefox, IE browsers,
even all these browser support XML/XSLT.
Anyone has some idea how should I make Apache Project XALAN's extension
work on a browser?
Thank Q!