如何获得元素的位置

时间:2008-11-25 15:26:08

标签: xslt

如何检索当前Para的位置?

<xsl:template match="Para">
    <xsl:variable name="PositionInDocument" select="What do I do here?" />
</xsl:template>

这是xml文档:

<QuestionStem>Question </QuestionStem>
<Para>This is my paragraph question.</Para>
<Para>Thisis another para for question.</Para>
<AnswerListItem>Answer</AnswerListItem>
<Para>This is my answer paragraph</Para>
<Para>This is another answer paragraph</Para>
<SubAnswerBulleted>Sub Answer Bulleted</SubAnswerBulleted>
<Para>This is a paragraph that is part of a sub answer.</Para>
<SubSubAnswerNumbered>Sub Sub Answer Numbered</SubSubAnswerNumbered>
<Para>This is a paragraph that is part of a sub sub answer.</Para>
<SubSubAnswerNumbered>Sub Sub Answer</SubSubAnswerNumbered>
<SubSubAnswerNumbered>Sub Sub Answer</SubSubAnswerNumbered>
<SubAnswerBulleted>Sub Answer Bulleted</SubAnswerBulleted>
<SubAnswerBulleted>Sub Answer</SubAnswerBulleted>

1 个答案:

答案 0 :(得分:5)

位置()

请参阅this