我有以下xsl :
<xsl:key name="kEventslegal"
match="HISTORY_EVENT"
use="concat(generate-id(
preceding-sibling::HISTORY_EVENT[
@Name='Item Acceptance Review event NO by Legal'
][last()]
),
'+',
generate-id(
following-sibling::HISTORY_EVENT[
@Name='Legal Report done'
][1])
)"/>
xml:
<ROOT>
<HISTORY_EVENT Name="Item Acceptance Review event NO by Legal"
EVENTSUBJECT="Item Acceptance Review event NO by Legal">
<EVENT_TIMESTAMP>31/01/2011 11:08:27</EVENT_TIMESTAMP>
<EVENT_STATE>opend</EVENT_STATE>
<EVENT_ROLE>Legal Unit Specialist</EVENT_ROLE>
<EVENT_USER>legal.test</EVENT_USER>
<EVENT_TYPE>normal</EVENT_TYPE>
<EVENT_PROCESS>Item Acceptance Review event NO by Legal Unit Specialist</EVENT_PROCESS>
<EVENT_MESSAGE>Item Acceptance Review event NO by Legal Unit Specialist legal.test</EVENT_MESSAGE>
</HISTORY_EVENT>
........
</ROOT>
有什么想法吗?
答案 0 :(得分:1)
此<xsl:key>
标识由两个特定HISTORY_EVENT
元素包围的所有HISTORY_EVENT
元素:
第一个 - 具有Name
属性且值为'Item Acceptance Review event NO by Legal'
最后一项 - 具有值Name
的{{1}}属性:'Legal Report done'
总结:看起来像所有法律报告的所有条目,审核结果为NO。