You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Adam Greene <ag...@romulin.com> on 2003/12/18 15:47:22 UTC

Help with CLASSPATH

I have read everything about classpath, I have run the EnvironmentCheck and
it reports Xalan 2.5.2 and all the files are in the lib/endorsed directory,
but when I use stylesheets with javascript it complains:

'The first argument to the non-static Java function 'getdate' is not a valid
object reference.'  Which makes me think it is using the wrong Xalan.

Here is the stylesheet I use (got it from the extensions examples):

<?xml version="1.0"?>
<!--Namespaces are global if you set them in the stylesheet element-->
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xalan="http://xml.apache.org/xalan"
    xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">

  <!--The component and its script are in the xalan namespace and define the
    implementation of the extension.-->
  <xalan:component prefix="my-ext" elements="timelapse" functions="getdate">
    <xalan:script lang="javascript">
      var multiplier=1;
      // The methods or functions that implement extension elements always
take 2
      // arguments. The first argument is the XSL Processor context; the
second
      // argument is the element node.
      function timelapse(xslProcessorContext, elem)
      {
        multiplier=parseInt(elem.getAttribute("multiplier"));
        // The element return value is placed in the result tree.
        // If you do not want a return value, return null.
        return null;
      }
      function getdate(numdays)
      {
        var d = new Date();
        var totalDays = parseInt(numdays) * multiplier;
        d.setDate(d.getDate() + totalDays);
        return d.toLocaleString();
      }
    </xalan:script>
  </xalan:component>

  <xsl:template match="deadline">
     <p><my-ext:timelapse multiplier="2"/>We have logged your enquiry and
will
      respond by <xsl:value-of
select="my-ext:getdate(string(@numdays))"/>.</p>
  </xsl:template>

</xsl:stylesheet>


-----Original Message-----
From: xalan-j-users-help@xml.apache.org
[mailto:xalan-j-users-help@xml.apache.org]
Sent: Thursday, December 18, 2003 10:43 AM
To: AGreene@romulin.com
Subject: WELCOME to xalan-j-users@xml.apache.org


Hi! This is the ezmlm program. I'm managing the
xalan-j-users@xml.apache.org mailing list.

Acknowledgment: I have added the address

   AGreene@romulin.com

to the xalan-j-users mailing list.

Welcome to xalan-j-users@xml.apache.org!

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address.


--- Administrative commands for the xalan-j-users list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <xa...@xml.apache.org>

To remove your address from the list, send a message to:
   <xa...@xml.apache.org>

Send mail to the following for info and FAQ for this list:
   <xa...@xml.apache.org>
   <xa...@xml.apache.org>

To get message 12 from the archive, send a message to:
   <xa...@xml.apache.org>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<xa...@xml.apache.org>

To stop subscription for this address, mail:
<xa...@xml.apache.org>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
xalan-j-users-owner@xml.apache.org. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <ag...@romulin.com>
Received: (qmail 70180 invoked from network); 18 Dec 2003 14:43:06 -0000
Received: from unknown (HELO mail.mergitech.com) (198.167.161.43)
  by daedalus.apache.org with SMTP; 18 Dec 2003 14:43:06 -0000
Received: from adam ([])
        by mail.mergitech.com (Merak 5.1.2) with SMTP id EZL73735
        for
<xalan-j-users-sc.1071758435.mfoagdfclalpnabnhjph-AGreene=romulin.com@xml.ap
ache.org>; Thu, 18 Dec 2003 10:42:47 -0400
From: "Adam Greene" <ag...@romulin.com>
To:
<xalan-j-users-sc.1071758435.mfoagdfclalpnabnhjph-AGreene=romulin.com@xml.ap
ache.org>
Subject: RE: confirm subscribe to xalan-j-users@xml.apache.org
Date: Thu, 18 Dec 2003 10:43:12 -0400
Message-ID: <HK...@romulin.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: <10...@xml.apache.org>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N



-----Original Message-----
From: xalan-j-users-help@xml.apache.org
[mailto:xalan-j-users-help@xml.apache.org]
Sent: Thursday, December 18, 2003 10:41 AM
To: AGreene@romulin.com
Subject: confirm subscribe to xalan-j-users@xml.apache.org


Hi! This is the ezmlm program. I'm managing the
xalan-j-users@xml.apache.org mailing list.

To confirm that you would like

   AGreene@romulin.com

added to the xalan-j-users mailing list, please send
an empty reply to this address:


xalan-j-users-sc.1071758435.mfoagdfclalpnabnhjph-AGreene=romulin.com@xml.apa
che.org

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

This confirmation serves two purposes. First, it verifies that I am able
to get mail through to you. Second, it protects you in case someone
forges a subscription request in your name.


--- Administrative commands for the xalan-j-users list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <xa...@xml.apache.org>

To remove your address from the list, send a message to:
   <xa...@xml.apache.org>

Send mail to the following for info and FAQ for this list:
   <xa...@xml.apache.org>
   <xa...@xml.apache.org>

To get message 12 from the archive, send a message to:
   <xa...@xml.apache.org>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<xa...@xml.apache.org>

To stop subscription for this address, mail:
<xa...@xml.apache.org>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
xalan-j-users-owner@xml.apache.org. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <AG...@romulin.com>
Received: (qmail 65136 invoked from network); 18 Dec 2003 14:40:35 -0000
Received: from unknown (HELO romulin.com) (156.34.200.45)
  by daedalus.apache.org with SMTP; 18 Dec 2003 14:40:35 -0000
Received: from adam by romulin.com
	with SMTP (MDaemon.v2.8.5.0.R)
	for <xa...@xml.apache.org>; Thu, 18 Dec 2003
10:44:29 -0400
Message-ID: <00...@adam>
From: "Adam Greene" <ag...@romulin.com>
To: <xa...@xml.apache.org>
Subject:
Date: Thu, 18 Dec 2003 10:39:58 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0005_01C3C553.48B2F130"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MDaemon-Deliver-To: xalan-j-users-subscribe@xml.apache.org
X-Return-Path: AGreene@romulin.com
Reply-To: agreene@romulin.com
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C3C553.48B2F130
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


------=_NextPart_000_0005_01C3C553.48B2F130
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0005_01C3C553.48B2F130--





Getting params from XSLTC

Posted by Marius Gleeson <ma...@audumla.net>.
Hi there,

I am currently using the following methods from the Stylesheet class to
get access to the parameters defined in a template,

  org.apache.xalan.templates.Stylesheet {
    .
    .
    ElemVariable getVariableOrParam(int i) 
    int getVariableOrParamCount()  
    .
    .
  }

I was wanting to know if there was an equivilant set of methods in the
XSLTC interfaces, or is there another way to get to them?

Thanks,
Marius.

RE: Help with CLASSPATH

Posted by Adam Greene <ag...@romulin.com>.
Never mind, I was using XSLTC.  I keep forgetting that it doesn't do
JavaScript.

-----Original Message-----
From: Adam Greene [mailto:agreene@romulin.com]
Sent: Thursday, December 18, 2003 10:47 AM
To: xalan-j-users@xml.apache.org
Subject: Help with CLASSPATH


I have read everything about classpath, I have run the EnvironmentCheck and
it reports Xalan 2.5.2 and all the files are in the lib/endorsed directory,
but when I use stylesheets with javascript it complains:

'The first argument to the non-static Java function 'getdate' is not a valid
object reference.'  Which makes me think it is using the wrong Xalan.

Here is the stylesheet I use (got it from the extensions examples):

<?xml version="1.0"?>
<!--Namespaces are global if you set them in the stylesheet element-->
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xalan="http://xml.apache.org/xalan"
    xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">

  <!--The component and its script are in the xalan namespace and define the
    implementation of the extension.-->
  <xalan:component prefix="my-ext" elements="timelapse" functions="getdate">
    <xalan:script lang="javascript">
      var multiplier=1;
      // The methods or functions that implement extension elements always
take 2
      // arguments. The first argument is the XSL Processor context; the
second
      // argument is the element node.
      function timelapse(xslProcessorContext, elem)
      {
        multiplier=parseInt(elem.getAttribute("multiplier"));
        // The element return value is placed in the result tree.
        // If you do not want a return value, return null.
        return null;
      }
      function getdate(numdays)
      {
        var d = new Date();
        var totalDays = parseInt(numdays) * multiplier;
        d.setDate(d.getDate() + totalDays);
        return d.toLocaleString();
      }
    </xalan:script>
  </xalan:component>

  <xsl:template match="deadline">
     <p><my-ext:timelapse multiplier="2"/>We have logged your enquiry and
will
      respond by <xsl:value-of
select="my-ext:getdate(string(@numdays))"/>.</p>
  </xsl:template>

</xsl:stylesheet>


-----Original Message-----
From: xalan-j-users-help@xml.apache.org
[mailto:xalan-j-users-help@xml.apache.org]
Sent: Thursday, December 18, 2003 10:43 AM
To: AGreene@romulin.com
Subject: WELCOME to xalan-j-users@xml.apache.org


Hi! This is the ezmlm program. I'm managing the
xalan-j-users@xml.apache.org mailing list.

Acknowledgment: I have added the address

   AGreene@romulin.com

to the xalan-j-users mailing list.

Welcome to xalan-j-users@xml.apache.org!

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address.


--- Administrative commands for the xalan-j-users list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <xa...@xml.apache.org>

To remove your address from the list, send a message to:
   <xa...@xml.apache.org>

Send mail to the following for info and FAQ for this list:
   <xa...@xml.apache.org>
   <xa...@xml.apache.org>

To get message 12 from the archive, send a message to:
   <xa...@xml.apache.org>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<xa...@xml.apache.org>

To stop subscription for this address, mail:
<xa...@xml.apache.org>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
xalan-j-users-owner@xml.apache.org. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <ag...@romulin.com>
Received: (qmail 70180 invoked from network); 18 Dec 2003 14:43:06 -0000
Received: from unknown (HELO mail.mergitech.com) (198.167.161.43)
  by daedalus.apache.org with SMTP; 18 Dec 2003 14:43:06 -0000
Received: from adam ([])
        by mail.mergitech.com (Merak 5.1.2) with SMTP id EZL73735
        for
<xalan-j-users-sc.1071758435.mfoagdfclalpnabnhjph-AGreene=romulin.com@xml.ap
ache.org>; Thu, 18 Dec 2003 10:42:47 -0400
From: "Adam Greene" <ag...@romulin.com>
To:
<xalan-j-users-sc.1071758435.mfoagdfclalpnabnhjph-AGreene=romulin.com@xml.ap
ache.org>
Subject: RE: confirm subscribe to xalan-j-users@xml.apache.org
Date: Thu, 18 Dec 2003 10:43:12 -0400
Message-ID: <HK...@romulin.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: <10...@xml.apache.org>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N



-----Original Message-----
From: xalan-j-users-help@xml.apache.org
[mailto:xalan-j-users-help@xml.apache.org]
Sent: Thursday, December 18, 2003 10:41 AM
To: AGreene@romulin.com
Subject: confirm subscribe to xalan-j-users@xml.apache.org


Hi! This is the ezmlm program. I'm managing the
xalan-j-users@xml.apache.org mailing list.

To confirm that you would like

   AGreene@romulin.com

added to the xalan-j-users mailing list, please send
an empty reply to this address:


xalan-j-users-sc.1071758435.mfoagdfclalpnabnhjph-AGreene=romulin.com@xml.apa
che.org

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

This confirmation serves two purposes. First, it verifies that I am able
to get mail through to you. Second, it protects you in case someone
forges a subscription request in your name.


--- Administrative commands for the xalan-j-users list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <xa...@xml.apache.org>

To remove your address from the list, send a message to:
   <xa...@xml.apache.org>

Send mail to the following for info and FAQ for this list:
   <xa...@xml.apache.org>
   <xa...@xml.apache.org>

To get message 12 from the archive, send a message to:
   <xa...@xml.apache.org>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<xa...@xml.apache.org>

To stop subscription for this address, mail:
<xa...@xml.apache.org>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
xalan-j-users-owner@xml.apache.org. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <AG...@romulin.com>
Received: (qmail 65136 invoked from network); 18 Dec 2003 14:40:35 -0000
Received: from unknown (HELO romulin.com) (156.34.200.45)
  by daedalus.apache.org with SMTP; 18 Dec 2003 14:40:35 -0000
Received: from adam by romulin.com
	with SMTP (MDaemon.v2.8.5.0.R)
	for <xa...@xml.apache.org>; Thu, 18 Dec 2003
10:44:29 -0400
Message-ID: <00...@adam>
From: "Adam Greene" <ag...@romulin.com>
To: <xa...@xml.apache.org>
Subject:
Date: Thu, 18 Dec 2003 10:39:58 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0005_01C3C553.48B2F130"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MDaemon-Deliver-To: xalan-j-users-subscribe@xml.apache.org
X-Return-Path: AGreene@romulin.com
Reply-To: agreene@romulin.com
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C3C553.48B2F130
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


------=_NextPart_000_0005_01C3C553.48B2F130
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0005_01C3C553.48B2F130--