1
来获取不同的元素我有下面元素命名查询表元素的列表,可重复,我需要获取不同的表格元素(而不是它的价值,但是标签/元素名称本身。需要通过XSLT
/ShopArea/Connection/Query/*
名单表名包括重复。
下面是XML
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="ShopArea.xslt"?>
<ShopArea>
<Connection name="Connection1">
<Report date="25-09-2011">
<Query id="1">
<TABLE1>1.1</TABLE1>
<TABLE2>1.2</TABLE2>
<TABLE3>1.3</TABLE3>
</Query>
<Query id="2">
<TABLE21>2.1</TABLE21>
<TABLE22>2.2</TABLE22>
<TABLE23>2.3</TABLE23>
</Query>
</Report>
<Report date="26-09-2011">
<Query id="1">
<TABLE1>26 1.1</TABLE1>
<TABLE2>26 1.2</TABLE2>
<TABLE3>26 1.3</TABLE3>
</Query>
<Query id="2">
<TABLE21>26 2.1</TABLE21>
<TABLE22>26 2.2</TABLE22>
<TABLE23>26 2.3</TABLE23>
</Query>
</Report>
</Connection>
</ShopArea>
我指的是How to select unique nodes in XSLT,但我无法做到。
好极了!它可以工作,但是这个代码(Muenchian分组)看起来太复杂了。需要一段时间才能理解。非常感谢你。 –
@ Arvind Singh:不客气。 Muenchian分组是高效XSLT 1.0分组的事实标准。为了更好地理解它,只需按照此答案的第一行中的链接 - 这会导致Jeni Tennison出色的Muenchian分组页面。 –