RE: [xsl] Javascript as an Include file in xsl

Subject: RE: [xsl] Javascript as an Include file in xsl
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Wed, 10 Oct 2001 11:02:20 -0700
This is very easy. You would do the same way as you would in a normal html
page.

When you build the page with XSLT just put something in the HTML HEAD like:

<SCRIPT LANGUAGE="JavaScript" SRC="&context;/js/project.js"/>

I use an entity to define the context that the site is running in. If set to
"" then it will pull the project.js from the docroot/js/. You could also
pass the context in as a global parameter.

BUT, do you need to build some arrays or something that will be used by the
JS? Then put all the static stuff in the include and and build your JS
arrays for each individual transformation.

best,
-Rob

p.s. once you understand XSLT a little more you can find that you probably
don't need as much JS as you would have thought.  It is not a maintainence
nightmare. It is the solution to the nightmare!

p.p.s unless I am missing something, you should get new consultants...


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Berent, Tom
> (MAN-Nashville-Corporate)
> Sent: Wednesday, October 10, 2001 10:47 AM
> To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: [xsl] Javascript as an Include file in xsl
>
>
> I been brought into an existing project that is XML/XSL based. Even with
> limited XSL experience, I see a huge maintenance nightmare evolving.
> According to the consultants working on the project with us, they
> have found
> no way to put needed client side JavaScript functions into an
> include file.
> So all JavaScript functions are being duplicated on every page.  Since the
> maintenance of this product will fall on my shoulders, I want to find a
> better solution.  Is there a way to include a .js file that the
> XSLT parser
> will accept?  Thank you for your time.
>
> Tom Berent
> Senior Software Engineer
> Manheim Interactive (Nashville)
> (p) 615-781-4497
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread