Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sorting 在创建数据表之前在xslt中排序_Sorting_Xslt_Xls - Fatal编程技术网

Sorting 在创建数据表之前在xslt中排序

Sorting 在创建数据表之前在xslt中排序,sorting,xslt,xls,Sorting,Xslt,Xls,我试图获取数据并将其放入表中,在输出到表之前对其进行排序,当我进行排序时,第一列和列的其余部分根本没有排序。我正在尝试按streetNuame进行排序,并且只对第一列表进行排序 <fo:table> <fo:table-column width="82mm"/> <fo:table-column width="82mm"/> <fo:table-column width="82mm"/> <fo:table-body>

我试图获取数据并将其放入表中,在输出到表之前对其进行排序,当我进行排序时,第一列和列的其余部分根本没有排序。我正在尝试按streetNuame进行排序,并且只对第一列表进行排序

<fo:table>
  <fo:table-column width="82mm"/>
  <fo:table-column width="82mm"/>
  <fo:table-column width="82mm"/>
  <fo:table-body>
    <xsl:for-each select="route/address[position() mod 3 = 1]">
      <xsl:sort select="streetName"/>
      <fo:table-row>
        <xsl:apply-templates select=". | following-sibling::*[3 > position()]"/>

        <xsl:variable name="vPos" select="position()"/>
        <xsl:variable name="vUnfilled"
        select=" 2 - count(following-sibling::*)"/>
        <xsl:if test="position() = last()">
          <xsl:for-each select="../*[not(position() > $vUnfilled)]">
            <fo:table-cell>
              <fo:block>
                <xsl:value-of select="' '"/>
              </fo:block>
            </fo:table-cell>
          </xsl:for-each>
        </xsl:if>
      </fo:table-row>
    </xsl:for-each>
  </fo:table-body>
</fo:table>

XML格式如下:

    <route>
       <name>blah</name>

       <address>
          <fullStreet>blah</fullStreet>
          <streetNumber>blah</streetNumber>
          <streetName>blah</streetName>

       </address>

废话
废话
废话
废话

XML是什么样子的?刚用XML代码更新过您有与
地址匹配的模板吗?如果是这样的话,您能告诉我们吗?您使用的是XSLT1.0还是XSLT2.0?XSLT1.0,是的,我有模板,我会尽快加载。