File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes How to include a javaScript file inside XSLT file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to include a javaScript file inside XSLT file?" Watch "How to include a javaScript file inside XSLT file?" New topic
Author

How to include a javaScript file inside XSLT file?

subbukumararaja chandrasekaran
Greenhorn

Joined: Sep 24, 2010
Posts: 17
Hi,

I need to include a java script file (poupcalendar.js) into XSLT file.

So that i can call the calender method from xslt components.

Below is my code in XSLT file.


When i try to invoke a method popUpCalendar() from popupcalender.js as below it is not recognizing and throwing some error.



Could some body help me on this?

-Subbu
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19552
    
  10

subbukumararaja chandrasekaran wrote:
When i try to invoke a method popUpCalendar() from popupcalender.js as below it is not recognizing and throwing some error.


Sure. Your first two steps are these:

(1) Figure out what is throwing the error (i.e. what is the "it" which you are talking about?)

(2) Figure out what is the "some" error (i.e. read the error message)

You can read TellTheDetails for more hints about how to describe problems on forums.
subbukumararaja chandrasekaran
Greenhorn

Joined: Sep 24, 2010
Posts: 17
here the "it" represents the button click.

the error i am getting after i clicked the button is


that is exactly on the line where i am calling PopupCalender().
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19552
    
  10

I see. So your problem appears to be entirely about Javascript in the browser and not really about XSLT at all, since the error message says there's something wrong with the Javascript.

Your original question was this:
How to include a javaScript file inside XSLT file?


However you did that. Your real problem is, I think, that you didn't include the right Javascript inside the XSLT file. Here's the two-step process you should be following:

(1) Figure out what Javascript you need in your HTML page. Get that debugged and working.

(2) Write XSLT which produces that Javascript.

You're asking about step (2) when you haven't finished step (1) yet.


Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19552
    
  10

I see. So your problem appears to be entirely about Javascript in the browser and not really about XSLT at all, since the error message says there's something wrong with the Javascript.

Your original question was this:
How to include a javaScript file inside XSLT file?


However you did that. Your real problem is, I think, that you didn't include the right Javascript inside the XSLT file. Here's the two-step process you should be following:

(1) Figure out what Javascript you need in your HTML page. Get that debugged and working.

(2) Write XSLT which produces that Javascript.

You're asking about step (2) when you haven't finished step (1) yet.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to include a javaScript file inside XSLT file?