Xml 分拣后跟踪位置
我一直在尝试将xsl应用于Analysis Service数据库返回的结果集。 结果集如下所示Xml 分拣后跟踪位置,xml,xslt,Xml,Xslt,我一直在尝试将xsl应用于Analysis Service数据库返回的结果集。 结果集如下所示 <Axis name="Axis1"> <Tuples> <Tuple> <Member Hierarchy="[Org].[Class1]"> <UName>[Org].[Class1].&[10629]</UName> <Caption>Ind
<Axis name="Axis1">
<Tuples>
<Tuple>
<Member Hierarchy="[Org].[Class1]">
<UName>[Org].[Class1].&[10629]</UName>
<Caption>Independent</Caption>
<LName>[Org].[Class1].[Ownership]</LName>
<LNum>2</LNum>
<DisplayInfo>65898</DisplayInfo>
<PARENT_UNIQUE_NAME>[Org].[Class1].&[2]</PARENT_UNIQUE_NAME>
</Member>
</Tuple>
<Tuple>
<Member Hierarchy="[Org].[Class1]">
<UName>[Org].[Class1].&[14331]</UName>
<Caption>A #5839</Caption>
<LName>[Org].[Class1].[Owner Region]</LName>
<LNum>3</LNum>
<DisplayInfo>65537</DisplayInfo>
<PARENT_UNIQUE_NAME>[Org].[Class1].&[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>