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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:17:33+00:00 2026-06-17T16:17:33+00:00

Does the performance of XSLT improve when xsl variable is used instead of XPath

  • 0

Does the performance of XSLT improve when xsl variable is used instead of XPath expression?
Update: I’m using Xalan for processing.

  • 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-17T16:17:34+00:00Added an answer on June 17, 2026 at 4:17 pm

    Does the performance of XSLT improve when xsl variable is used instead
    of XPath expression?

    This depends on the XSLT processor being used. If the XSLT processor has a good optimizer, in many cases it does the factorization by itself and there is no real speed gain doing this by hand.

    However:

    1. “Saving” the result of evaluation in a variable can make the code shorter and more readable.

    2. This is a good application of the DRY (Don’t Repeat Yourself) best practices.

    3. Relying on the Optimizer not always works.

    4. We shouldn’t rely on optimizers when writing portable code, that is intended to be executed by more than one different XSLT processors — such as when writing a library of functions/templates.

    With some XSLT 2.0 processors, such as Saxon, one can even have xsl:function execution optimized, by turning on function memoization. In the case of Saxon this is done by setting the extension attribute saxon:memo-function to "yes".

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

Sidebar

Related Questions

What is the purpose of using the Boost.MPI library? Does it increase performance? And
Is the jQuery live method using setInterval to update the events? Does this affect
How does one performance tune a SQL Query? What tricks/tools/concepts can be used to
What has more performance in XSLT while writing an XHTML element <xsl:element name=div> <xsl:attribute
Does performance of a database (SQL Server 2005) decrease if I shrink it? What
How does performance for reading/adding values from/to Dictionary(Of String, SomeReferenceType) depend on the number
I guess you already know the question ;) Does the performance wizard only exist
Does windows have performance counters to measure statistics of a dialup connection? Opening up
Does logging decreases application performance? and how to restrict display-tags logs to be printed
Does COUNT(*) have any significant impact for MySQL performance if query already has GROUP

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.