0

我正在尝试获取数据并将其放入表中并在输出到表之前对其进行排序,并且当我这样做时对第一列进行排序,而该列的其余部分根本没有排序。我正在尝试按 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>
4

0 回答 0