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 6827973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:19:43+00:00 2026-05-26T22:19:43+00:00

I need a div to have the following Javascript associated with it: onclick=resize(‘Value1’, ‘Value2’,

  • 0

I need a div to have the following Javascript associated with it:

onclick="resize('Value1', 'Value2', 'Value3', 'Value4')"

In my XSL, var1, var2, var3, var4 hold stringsValue1, Value2, Value3, Value4 for current node. So, using xsl:attribute name='onclick', I would like to associate the JS with the div. The problem I am facing is because of escaping single quotes in XSL to render it in output page (that is what I think).

Any idea how to go about it?

EDIT:
My XSL code to get the javascript onclick function call string is:

<xsl:value-of select="concat('resize(', '&apos;', $var1, '&apos;', ',', '&apos;', $var2, '&apos;', ',', '&apos;', $var3, '&apos;', ',', '&apos;', $var4, '&apos;', ')'"/>

And IE6 [Yes its IE6, my machine has XP with IE6 🙁 ] shows the error:

Expression expected. concat('resize(', ''', $var1, ''', ',', ''', $var2, ''', ',', ''', $var3...
  • 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-05-26T22:19:44+00:00Added an answer on May 26, 2026 at 10:19 pm

    Funny enough there seems to be no real good escape sequence for single quotes inside attribute values. You should be able to go with:

        <xsl:attribute name="onClick">resize('<xsl:value-of select="$var1"/>','<xsl:value-of select="$var2"/>','<xsl:value-of select="$var3"/>', '<xsl:value-of select="$var4"/>')</xsl:attribute>
    

    At least IntelliJ likes this. It is a bit long-winded but should be safe to use even with older XSLT processors like IE6. I have no IE6 here to check it, though. Btw. IE6 is somewhat outdated technology, so you should really get rid of it.

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

Sidebar

Related Questions

I have the following javascript working to insert AJAX responses into a div with
I have the following code: <div id=widHolder></div> <script type=text/javascript language=javascript> $('#widHolder').widgetName({ optionOne: false, optionTwo:
I have the following html <div id=list_item_template><li><a href=#>Text</a></li></div> and javascript: var item = $(#list_item_template).clone();
i have the following lines of html code - <div class=twitters id=cbd> <p><a href=javascript:;
I have a strange need. I would like to do the following in javascript:
All, I have the following html as a string in javascript. I need to
I have the following jQuery <script type=text/javascript> jQuery(function(){ jQuery('.link1').click(function(){ jQuery('.hide-div').hide(); jQuery('.toggle1').show(); jQuery('#arrow').css({top: '0px'}); });
I have a div in which I need a permanent vertical scrollbar. Sometimes the
i have text like this div bla-bla end div i need to get only
I have outer div and inner div. I need to place inner div at

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.