[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

strange issue with execution order of range expression

Subject: strange issue with execution order of range expression (for $x in 1 to $y)
From: "Robby Pelssers" <robby.pelssers@xxxxxxxxx>
Date: Thu, 17 Dec 2009 13:54:46 +0100
 strange issue with execution order of range expression
Hi all,

I have following template which calls a custom function I wrote for a certain

   | This template handles the Topic 'Pinning information'  (->
CharacteristicSet 'Pinning information')
   | Note: We need to take the simplified outline graphic from the package
instead of the product
  <xsl:template match="Topic[@id='pinning_information']" mode="topic">
    <xsl:variable name="pinChar"
m) and Parameter/@DETIdentifier='PAE050']"/>
    <xsl:variable name="symbolChar"
m) and Parameter/@DETIdentifier='PAE051']"/>
    <xsl:variable name="descriptionChar"
m) and Parameter/@DETIdentifier='PAE061']"/>
    <xsl:variable name="simplifiedOutline_FigureCode"
and Parameter/@DETIdentifier='PAF008']/Values/Value"/>   
    <xsl:variable name="graphicSymbol_FigureCode"
m) and Parameter/@DETIdentifier='PAF002']/Values/Value"/>       
    <!-- we can count the rowSize based on pin, symbol or description rows,
here we count the number of pin rows-->
    <xsl:variable name="rowSize" select="count($pinChar/Values/Value)"/>
    <p-topic id="{@id}">
      <title><xsl:value-of select="@title"/></title>
      <xsl:call-template name="prolog"/>
        <table tabletype="nonQuantitative">
          <title><xsl:value-of select="if (@tabletitle) then @tabletitle else
          <tgroup cols="5">
            <colspec colnum="1" colname="col1" colwidth="*"/>
            <colspec colnum="2" colname="col2" colwidth="*"/>
            <colspec colnum="3" colname="col3" colwidth="*"/>
            <colspec colnum="4" colname="col4" colwidth="*"/>
            <colspec colnum="5" colname="col5" colwidth="*"/>         
                <entry colname="col1">
                <entry colname="col2">
                <entry colname="col3">
                <entry colname="col4">
                  <p>Simplified outline</p>
                <entry colname="col5">
                  <p>Graphic symbol</p>
              <xsl:copy-of select="for $i in (1 to $rowSize) return
(nxp:getPinningTableRow($rowSize, $i, $pinChar, $symbolChar, $descriptionChar,
$simplifiedOutline_FigureCode, $graphicSymbol_FigureCode))"
  <xsl:function name="nxp:getPinningTableRow">
    <xsl:param name="rowSize"/>
    <xsl:param name="rowIndex"/>
    <xsl:param name="pinChar"/>
    <xsl:param name="symbolChar"/>
    <xsl:param name="descriptionChar"/>
    <xsl:param name="simplifiedOutline_FigureCode"/>
    <xsl:param name="graphicSymbol_FigureCode"/>
    <row rowIndex="{$rowIndex}"/>

The weird thing is that the generated <tbody> looks like

  <row rowIndex="5"/>
  <row rowIndex="1"/>
  <row rowIndex="2"/>
  <row rowIndex="3"/>
  <row rowIndex="4"/>

Is a range not supposed to be executed in order 1 -> 2 -> 3-> 4-> 5 ??  Or
what could potentially mess-up the execution order of calling this function?

Robby Pelssers

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.