Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.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
Xml 分拣后跟踪位置_Xml_Xslt - Fatal编程技术网

Xml 分拣后跟踪位置

Xml 分拣后跟踪位置,xml,xslt,Xml,Xslt,我一直在尝试将xsl应用于Analysis Service数据库返回的结果集。 结果集如下所示 <Axis name="Axis1"> <Tuples> <Tuple> <Member Hierarchy="[Org].[Class1]"> <UName>[Org].[Class1].&amp;[10629]</UName> <Caption>Ind

我一直在尝试将xsl应用于Analysis Service数据库返回的结果集。 结果集如下所示

<Axis name="Axis1">
  <Tuples>
    <Tuple>
      <Member Hierarchy="[Org].[Class1]">
        <UName>[Org].[Class1].&amp;[10629]</UName>
        <Caption>Independent</Caption>
        <LName>[Org].[Class1].[Ownership]</LName>
        <LNum>2</LNum>
        <DisplayInfo>65898</DisplayInfo>
        <PARENT_UNIQUE_NAME>[Org].[Class1].&amp;[2]</PARENT_UNIQUE_NAME>
      </Member>
    </Tuple>
    <Tuple>
      <Member Hierarchy="[Org].[Class1]">
        <UName>[Org].[Class1].&amp;[14331]</UName>
        <Caption>A #5839</Caption>
        <LName>[Org].[Class1].[Owner Region]</LName>
        <LNum>3</LNum>
        <DisplayInfo>65537</DisplayInfo>
        <PARENT_UNIQUE_NAME>[Org].[Class1].&amp;[10629]</PARENT_UNIQUE_NAME>
      </Member>
    </Tuple>
    ....
  </Tuples>
</Axis>

<CellData>
  <Cell CellOrdinal="0">
    <FmtValue>Ownership</FmtValue>
  </Cell>
  <Cell CellOrdinal="1">
    <ForeColor>0</ForeColor>
    <FmtValue>73%</FmtValue>
  </Cell>
  <Cell CellOrdinal="2">
    <ForeColor>0</ForeColor>
    <FmtValue>68%</FmtValue>
  </Cell>
  <Cell CellOrdinal="3">
    <ForeColor>0</ForeColor>
    <FmtValue>70%</FmtValue>
  </Cell>
  <Cell CellOrdinal="4">
    <ForeColor>0</ForeColor>
    <FmtValue>59%</FmtValue>
  </Cell>
  <Cell CellOrdinal="5">
    <FmtValue>Owner Region</FmtValue>
  </Cell>
  <Cell CellOrdinal="6">
    <ForeColor>0</ForeColor>
    <FmtValue>75%</FmtValue>
  </Cell>
  .....
</CellData>
并希望使用以下类似的方法对元组进行迭代

<xsl:for-each select="key('tuples-by-parentUName', $thisQuestion/xa:Member/xa:UName)">
<xsl:sort data-type="number" select="xa:Member/xa:LNum" order="descending"/>

这里我需要元组的原始位置,以便计算单元的位置


已经花费了很多时间,但无法解决此问题。

xsl:for each
中:

<xsl:variable name="originalPosition" select="count(preceding::xa:Tuple) + 1"/>


xsl:for each
中:

<xsl:variable name="originalPosition" select="count(preceding::xa:Tuple) + 1"/>



为什么用
UName
查询
tuples byparentUName
为什么用
UName
查询
tuples byparentUName
<xsl:variable name="originalPosition">
    <xsl:number count="xa:Tuple" level="any"/>
</xsl:variable>