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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:09:34+00:00 2026-05-11T15:09:34+00:00

What are the principles and patterns that go into writing effective XSLT? When I

  • 0

What are the principles and patterns that go into writing effective XSLT?

When I say ‘effective’ I mean that it is

  1. Well-structured and readable
  2. Simple, concise
  3. Efficient (i.e. has good performance)

In short, I’m looking for the best practices for XSLT.

I’ve already seen the question regarding efficiency, but efficient code loses its value if you can’t understand what it’s doing.

  • 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-11T15:09:35+00:00Added an answer on May 11, 2026 at 3:09 pm

    I think that a good way to answer this question would to approach it from the other side. What practices make XSLT ineffective, and why?

    Some of the things that I’ve seen that result in ineffective XSLT:

    1. Overuse of for-each. Everyone’s said it; I’m saying it again. I find that for-each is often a sign of the developer trying to employ traditional programming techniques in a declarative language.

    2. Underutilizing XPath. A lot of bad XSLT I’ve seen exists purely because the developer didn’t understand predicates, axis specifiers, position(), and current(), and so he implemented logic using XSLT constructs instead.

    3. Underutilizing metadata. You can sometimes eliminate an enormous amount of XSLT by providing your transform with metadata.

    4. Underutilizing pre-processing. If, for instance, an XML document contains data that has to be parsed using XSLT string manipulation, it’s often much simpler to do all of the parsing outside of XSLT and either add the parsed results to the XML or pass the parsed results as an argument to the transform. I’ve seen some remarkably unmaintainable XSLT implementing business logic that would be trivial to implement in C# or Python.

    The biggest problem that I’m running into in my own XSLT world (I have several 3,000+ line transforms that I’m maintaining) is dead code. I’m certain that there are templates in my transforms that will never be used again, because the conditions they’re testing for will never arise again. There’s no way to determine programmatically if something like <xsl:template match='SomeField[contains(., 'some value')]> is alive or dead, because it’s contingent on something that metadata can’t tell you.

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

Sidebar

Related Questions

Are there some principles of organizing classes into namespaces? For example is it OK
I know that one of the defining principles of Test driven development is that
I'm retro-fitting an older vb.net application to bring it into compliance with LUA principles
I am writing an app for iOS that uses data provided by a web
I'm writing a server program in Java that will allow users to submit jobs
What principles do you generally follow when doing class design?
Looking at the cool new principles of software development: Agile You Ain't Gonna Need
I've been wondering what exactly are the principles of how the two properties work.
Update: Please read this question in the context of design principles, elegance, expression of
I was listening to a podcast . Where they talked about principles Toyota was

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.