Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSL sorting of results from recursive calls to document()?

From: felciano <felciano@-----.--->
To: NULL
Date: 10/5/2008 9:11:00 PM
Hello --

I am trying to use XSL to process Amazon wishlist data to sort the
results by type (Apparel, then Books, then DVDs, etc). Amazon's web
services chunk up results in multiple pages of fixed size, e.g. 55
items gets returned in 5 XML pages of 10 items and a 6th of 5 items.
Each page is returned from a distinct URL call with a PageNum
parameter.

I've been trying to adapt a technique described at http://www.xefer.com/amazon/wishlist
that shows how to iterate through such pages through recursive
document() calls and a document counter:

<xsl:template name="counter">
  <xsl:param name="total"/>
  <xsl:param name="page"/>

  <xsl:variable name="lookup"
    select="concat($lookup, '&amp;ProductPage=', $page)

  <xsl:if test="$page <= $total">
    <xsl:apply-templates select="document($lookup)"/>
    <xsl:call-template name="counter">
      <xsl:with-param name="total" select="$total"/>
      <xsl:with-param name="page" select="$page + 1"/>
    </xsl:call-template>
  </xsl:if>

</xsl:template>

This works, but I can't figure out how to sort the aggregate results.
Each document's nodes are processed separately before the next page is
retrieved. Is there a convention / idiom for how to handle sorting
when iterating via recursion across multiple document() calls?

Thanks,

Ramon


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent