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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:20:08+00:00 2026-05-11T16:20:08+00:00

Consider this condition that exists in a template that is called recursively: <xsl:if test=$i

  • 0

Consider this condition that exists in a template that is called recursively:

<xsl:if test="$i &lt;= $count">

I’m using an XSLT 2.0 processor (Saxon-B 9.1.0.6). The condition seems to work only when running an XSLT 1.0 stylesheet. When the stylesheet version is set to 2.0 (as it should be), it stops working.

Any ideas why?

Here’s the whole thing:

<xsl:template name="for.loop">
    <xsl:param name="i" />
    <xsl:param name="count" />

    <xsl:if test="$i &lt;= $count">
    ...
    </xsl:if>

    <!-- Repeat the loop by recursion -->
    <xsl:if test="$i &lt;= $count">
        <xsl:call-template name="for.loop">
            <xsl:with-param name="i">
                <xsl:value-of select="$i + 1" />
            </xsl:with-param>
            <xsl:with-param name="count">
                <xsl:value-of select="$count" />
            </xsl:with-param>
        </xsl:call-template>
    </xsl:if>
</xsl:template>

Thanks.

  • 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-11T16:20:08+00:00Added an answer on May 11, 2026 at 4:20 pm

    Here is my suspicion: Depending on what data types $i and $count are, the “less than” test may fail in 2.0 (which supports more data types than 1.0), where in 1.0 an implicit conversion exists that does the right thing.

    Try to convert the data to the right type before you compare it, e.g. using number().

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

Sidebar

Related Questions

Consider this template function: template<typename ReturnT> ReturnT foo(const std::function<ReturnT ()>& fun) { return fun();
Consider this example var task =Task.Factory.StartNew(()=>Console.WriteLine(test)); task.ContinueWith(antecendent => { ExceptionProcessor.HandleError(task.Exception.Flatten()); }, TaskContinuationOptions.OnlyOnFaulted); In this
Please consider the following code and the explanation from this Mozilla tutorial Using web
Please consider this code: System.Linq.Expressions.Expression<Func<tbl, bool>> exp_details = r => r.ID_Master == Id &&
Consider this C++ code for(int i=0; i<=N; ++i) { if(/* Some condition 1 */)
Consider the following code that I'm using when displaying a Customer's mailing address inside
Consider this code: enum { ERR_START, ERR_CANNOTOPENFILE, ERR_CANNOTCONNECT, ERR_CANNOTCONNECTWITH, ERR_CANNOTGETHOSTNAME, ERR_CANNOTSEND, }; char* ERR_MESSAGE[]
Consider this contrived, trivial example: var foo = new byte[] {246, 127}; var bar
Consider this (rather pointless) javascript code: function make_closure() { var x = 123, y
Consider this simple model: A base Location table: +-------------------------------+ | Locations | +-------------------------------+ |(PK)

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.