Azazel
Azazel

Reputation: 23

XSLT limit on 500?

A client/customer of ours contacted us about a possible bug and after some searching for an error, we can't really find one.

The problem is that the client has a guestbook, which is a list of comments so we simply put list all comments but for some reason it can't get past 500. 1-499 is the posts that we get back. I have made a simple XSLT script for trying out it but can't get more than 500 either.

Here is my test script:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
 exclude-result-prefixes="msxsl">
    <xsl:output method="html" indent="yes"/>
    <xsl:template match="/">
        <ol>
            <xsl:for-each
                 select="/descendant::node[@id='6221']
                            /node[@nodeTypeAlias = 'BlogPostComment']">
                <!--<xsl:sort select="@id" order="descending" />-->
                <li>
                    <xsl:value-of select="@nodeName"/>
                    <p>
                        <xsl:value-of select="./data[@alias = 'comment']"/>
                    </p>
                </li>
            </xsl:for-each>
        </ol>
    </xsl:template>
</xsl:stylesheet>

I have tried the script both with and without the xslt:sort but neither gives me more posts. Is there some kind of limit in XSLT that makes it impossible to get more than 500 subnodes in a for-each? Apparently count(...) doesn't get more than 499 either. There is a count in the XSLT script running on the clients site and it shows 499 too.

EDIT:
Turned out there is nothing wrong other than the id which the client sorted the post by was converted to string and thereby the 10000 node id's was no longer bigger (sorting wise) than the 9000 node id's and these new posts was showed first in the list since the first nodes had id's starting at 6000. We just changed the sorting field and it all worked just fine again.

Upvotes: 1

Views: 530

Answers (1)

Adam Batkin
Adam Batkin

Reputation: 53024

No, XSLT itself has no limit, however XSLT is a specification, not an implementation. That said, I would find it hard to believe that an XSLT implementation would have arbitrary limits in the way that you are describing.

Consider looking at the source XML data. Perhaps something there is causing the issue. Maybe whatever is writing the data is accidentally truncating it to 500 records.

Upvotes: 2

Related Questions