Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9200729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:49:56+00:00 2026-06-17T22:49:56+00:00

I have a XSL template that uses a miniaturized javascript file J1. It can

  • 0

I have a XSL template that uses a miniaturized javascript file J1. It can be assumed that J1 is impossible to trace and reverse engineer.

The problem I have is that there is a slightly more updated version of J1 (called J1a) and I am interested to use J1 for some parts of the code and J1a for other parts of the code in the same template. Obviously, including both in the same file will be problematic due to duplicate classes and functions. I’ve tried to no avail to wrap either J1 or J1a into a pseudo-namespace (Javascript does not support namespaces or modules) with the following code:

function mynamespace() {
  this.container = {
  // insert monstrous javascript blob
  }
} // which then is expected to do sth like mynamespace.Container.SomeFunction()

I’ve also tried a dirty refactor by just manually renaming a gazillion names (which is very error-prone), but neither approach work.

During the writing of this post, I’ve thought of a third approach, which is to add a function X() in J1 and a function Y() in J1a and then delegate my tasks to those wrapper functions which should solve the problem due to the fact that J1 and J1a do not import each other. However, I’ve not tested this and I am not an experienced javascript writer.

Edit:

Since all I really need from J1 and J1a is the following:

MyObject.SomeStaticMethod();
MyObject obj = new MyObject(args);
obj.SomeInstanceMethod();

then maybe I can do:

 function X(var args) {
     MyObject.SomeStaticMethod();
     MyObject obj = new MyObject(args);
     obj.SomeInstanceMethod();
 }
 function Y(var args) {
     MyObject.SomeStaticMethod();
     MyObject obj = new MyObject(args);
     obj.SomeInstanceMethod();
 }

and add X to J1 and Y to J1a and then call X() and Y() selectively in the XSL template?

Edit 2: It turns out the giant miniaturized javascript blob does not contain conventional global variables, but something that’s about as bad – variables tethered to the windows object.

With that said, is there any way to somehow split the rendering of the HTML so that one part only has one copy in the global scope and another part has the other copy in the global scope? I’ve heard there’s some “tile approach” with JSP. Frames is also a possibility, although I heard there’s a slew of problems with using them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:49:57+00:00Added an answer on June 17, 2026 at 10:49 pm

    here’s a variant that mimics what node does.

    function mynamespace() {
      var container = {};
    
      // insert giant blob here
    
      container.exposed1 = something_to_expose;
      container.exposed2 = something_else_to_expose;
    
      return container;
    }
    

    then use

    var v1 = mynamespace();
    v1.exposed1();
    

    etc….

    You also need to make sure your giant blob does not use any global variables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a xml that looks like below <xsl:template match=//xml> <xsl:for-each select=//z:row> <ul class
I have an XSL template that is selected for execution (below). What I would
I have an xml column ExportTemplate in a table that holds an xsl template
I have XSL code that looks like this... <xsl:template name=doHeader> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE9 />
I have a xsl template which can replace some xml values. Now I want
I have a javascript file that looks like this: if (x > 0 &&
I have an XSL file which uses a a static website link as shown
I have xml file below: <?xml version=1.0 encoding=utf-8 ?> <?xml-stylesheet version=1.0 type=text/xml href=template.xsl ?>
I am developing a Firefox extension that uses XSL transformations. I have been using
I have an xsl that copies a xml file and renames the root tag.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.