472,986 Members | 3,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

Apache Project Xalan XML/XSLT Processor Is Good, But Its ExtensionNot Work on Netscape/IE

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!
Jul 21 '05 #1
7 4065
Try the XSL forum at http://www.tek-tips.com/

"RC" <ra**********@nospam.noaa.gov> wrote in message
news:d4**********@news.nems.noaa.gov...
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?


The XALAN extension is for server-side transformations. Client-side
transformations are performed by the transformation engine which is built
into the individual browser. You CANNOT tell the browser to use a different
transformation engine.

--
Tony Marston

http://www.tonymarston.net

Jul 21 '05 #2
RC wrote :
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

The line...
<?xml-stylesheet type="text/xsl"
href="http://myHostName/XML/myfile.xsl" ?>
sould be....
<?xml:stylesheet type="text/xsl"
href="http://myHostName/XML/myfile.xsl" ?>

--
eat beef jerky

Jul 21 '05 #3
Disco Octopus wrote:
The line...
<?xml-stylesheet type="text/xsl"
href="http://myHostName/XML/myfile.xsl" ?>
sould be....
<?xml:stylesheet type="text/xsl"
href="http://myHostName/XML/myfile.xsl" ?>


Read <http://www.w3.org/TR/xml-stylesheet/>.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 21 '05 #4
Johannes Koch wrote :
Disco Octopus wrote:
The line...
<?xml-stylesheet type="text/xsl" href="http://myHostName/XML/myfile.xsl"
?>
sould be....
<?xml:stylesheet type="text/xsl" href="http://myHostName/XML/myfile.xsl"
?>


Read <http://www.w3.org/TR/xml-stylesheet/>.


I see.

--
if you pay for your gym memebership, use it

Jul 21 '05 #5


RC wrote:

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')" /> 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
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?


Use XSLT 1.0 without extensions if you want different XSLT processors to
be able to process your stylesheet and give you the desired result.
Using extension functions (written in Java or JavaScript) makes your
stylesheet incompatible.
Netscape/Firefox does not support extension functions in XSLT, neither
written in JavaScript nor in Java.
IE uses MSXML as the XSLT processor, that has support for extension
functions written in an Active Scripting language like JScript or
VBScript but don't expect the object model exposed to script to be the
same as with Xalan.

You have to decide what you want to achieve, if you think you need XSLT
with extension functions then you are usually bound to one certain XSLT
processor which you could for instance use on the server to do
transformations where the transformation result output is then sent to
the browsers so that those only have to deal with HTML.

If you want to use XSLT on different clients then you can't use
extensions, there is a project EXSLT (http://www.exslt.org/) but don't
expect support for that across browsers like Mozilla and IE and Safari.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 21 '05 #6
RC
Martin Honnen wrote:
Netscape/Firefox does not support extension functions in XSLT, neither
written in JavaScript nor in Java.
IE uses MSXML as the XSLT processor, that has support for extension
functions written in an Active Scripting language like JScript or
VBScript but don't expect the object model exposed to script to be the
same as with Xalan.


Remember last centure during 1990s, sometime you wrote a HTML page it
only can work in Netscape but not work in IE. Or work in IE but not work
in NS. We really don't wish the history repeat, BW2 (Brwoser War II).

I thought XML will end the browser war. But now seems to me a new
browser is starting from XSLT.
Jul 21 '05 #7


RC wrote:
Remember last centure during 1990s, sometime you wrote a HTML page it
only can work in Netscape but not work in IE. Or work in IE but not work
in NS. We really don't wish the history repeat, BW2 (Brwoser War II).

I thought XML will end the browser war. But now seems to me a new
browser is starting from XSLT.


If you want to use XSLT then it is best used on the server to transform
your XML to HTML that you send to the browsers. Client-side XSLT does
not have enough support, IE 6 has support for XSLT 1.0 (or IE 5/5.5 with
an updated MSXML installation), Mozilla has XSLT 1.0 support, I think
Safari since 1.3 has it too but other browsers not. And as I have
already said, if you want to use XSLT with different processors the
stick to the XSLT standard and do not use extensions.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Johannes Lebek | last post by:
Hi there, I made some changes to my XSL stylesheet and now Xalan 2.5.1 is facing ClassCastExceptions. I'm pretty sure, that the changes I made should work (they are quite complicated -- I'd like...
0
by: Chris Bedford | last post by:
Hello, I'm using Xalan and I have a bunch of xslt documents that were constructed to run with another processor that has alot of custom extension functions. The names of these functions ...
1
by: Brian J. Sayatovic | last post by:
I'm using Xalan-J to loop through some nodes with an xsl:for-each element, presumably in document order. As far as I can tell, the XSL speciciation says that a for-each element will loop through...
7
by: Ganesh Gella | last post by:
Hi All, I am planning to use Xalan to transform XML data by applying xls stylesheets. Here tricky part is, Xalan provides several C++ APIs, which are very much useful if our requirement is...
2
by: Dr. Roger Wießner | last post by:
Hello! I am a newbie to XSLT and need a freeware/GNU Tool to get experience with this new topic. Which one is a good XSLT? Xalan or Saxon, or which one else? Thank you a lot!
3
by: Jeff Calico | last post by:
Hello everyone I am transforming an XML document to text, basically only outputting a small portion of it. When I run the following XSLT via Xalan's processor, I get a bunch of unwanted blank...
2
by: Felix Engelhardt | last post by:
Hi there, I'm having a problem compiling an XSL-stylesheet using JAXP/Xalan which is really driving me nuts... When I try to compile a stylesheet that contains something like: <xsl:value-of...
3
by: RC | last post by:
Let's say: if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { // Now I got an XML object here var xmlDocument = XMLHttpRequestObject.responseXML; // next I have...
8
by: DarthLuch | last post by:
Would like to get feedback on a process we do, as well as suggested alternatives. We produce a software for the airline biz... One of the features is take take aircraft OEM provided SGML/XML...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.