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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:03:15+00:00 2026-05-11T02:03:15+00:00

I have an XSLT for viewing XML files in the browser. The XSLT is

  • 0

I have an XSLT for viewing XML files in the browser. The XSLT is naively written and currently takes a long time to execute (several minutes).

My XML file is of modest size (~1 MiB), and other XSLTs for the same document that do different processing execute much more quickly. So I know it isn’t the size of the XML that is the problem, it’s my XSLT.

How do I go about profiling and optimizing my XSLT?

(Is it a bad idea to be doing complex XSLTs in the browser? Should I instead apply the XSLT application side?)

  • 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. 2026-05-11T02:03:15+00:00Added an answer on May 11, 2026 at 2:03 am

    which XSLT engine are you using? If you are using the .NET engine and Visual Studio you could use the XSLT profiler integrated into Visual Studio which is a very useful.

    Other excellent profiling tools are Altova’s XML Spy and Oxygen.

    If you would post your XSLT it would be easier to tell you where possible bottlenecks are. In general be careful with XPath expressions such as ‘//’, preceding::* and following::*. Some more rules and best-practices:

    1. Avoid repeated use of '//item'.
    2. Don’t evaluate the same node-set more than once; save it in a variable.
    3. Avoid <xsl:number> if you can. For example, by using position().
    4. Use <xsl:key>, for example to solve grouping problems.
    5. Avoid complex patterns in template rules. Instead, use within the rule.
    6. Be careful when using the preceding[-sibling] or following[-sibling] axes. This often indicates an algorithm with n-squared performance.
    7. Don’t sort the same node-set more than once. If necessary, save it as a result tree fragment and access it using the node-set() extension function.
    8. To output the text value of a simple #PCDATA element, use <xsl:value-of> in preference to <xsl:apply-templates>.

    (from http://www.dpawson.co.uk/xsl/sect4/N9883.html#d15756e150)

    Following these rules will typically result in very efficient XSLT and you possibly won’t need to use a profiler at all.

    Concerning your question about XSLT in the browser: I wouldn’t recommend it because first you are not platform independent (not every browser might support it or some browsers may only support it with a poorly performing engine) and second you can’t control the engine used.

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

Sidebar

Related Questions

I have XSLT and XMl files to treat. I need to know how to
I have an XSLT(2.0) file; which takes an input XML data file and creates
we have XSLT to transform XML into HTML in XHTML 1.0 Strict in XSLT
I have a .xslt that translates xml from one form to another (I'm not
I have an XSLT stylesheet that transforms an XML file to JSON format and
I currently have a XSLT 2.0 Stylesheet that I am trying to remove empty
i have this XSLT and XML payload that i am wanting to transform. but
i have complex xslt that formats xml to html now i need to be
I have an XSLT stylesheet that needs to emit an XML fragment that looks
I have a task at work that involves converting legacy SGM files into XML.

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.