<listings>
<property rln="r317080" firm="f102" agent="a2140">
<street>2638 Maple Avenue</street>
<city>Padua</city>
<state>WI</state>
<zip>53701</zip>
<price>229000</price>
<style>2 Story Contemporary, Transitional</style>
<sqfeet>2328</sqfeet>
<bathrooms>2 1/2</bathrooms>
<bedrooms>4</bedrooms>
<garage>2 car, attached</garage>
<age>22</age>
<description>Very nice home on a one block dead end street with woods nearby.
Very special location for quiet and privacy! Home features open floor plan with
large rooms - new patio doors to pretty yard. updates: shingles, vinyl siding,
refrig and dishwasher, garage door. Fireplace in family room flanked by great
built-ins. add first floor laundry and award winning Padua schools.
</description>
</property>
<property ...>
<city>Broxton</city>
...
</property>
<property ...>
<city>Cutler</city>
...
</property>
<property ...>
<city>Argyle</city>
...
</property>
<property ...>
<city>Stratmore</city>
...
</property>
<property ...>
<city>Padua</city>
...
</property>
<property ...>
<city>Oseola</city>
...
</property>
<property ...>
<city>Fenmore</city>
...
</property>
<property ...>
<city>Cutler</city>
...
</property>
<property ...>
<city>Padua</city>
...
</property>
<property ...>
<city>Cutler</city>
...
</property>
<property ...>
<city>Oseola</city>
...
</property>
</listings>
在我的書(由帕特里克·凱里XML第二版)提供使用「Muenchian分組的」尋找獨特的選擇的示例。我不明白的部分是這樣的:XSLT - 訪問Key的使用索引 - 例如,在Muenchian分組的
它到達這裏,在它的例子的進程中,它聲明:「 property [generate-id()= generate-id(key(」cityNames「,「卡特勒」)[1])] 「,這表示,這將找到的第一個‘卡特勒’在選擇時,由於索引‘[1]’。這給出上述XML將返回 「庫特勒」
現在的例子進行至這樣的: 「 屬性[生成-ID()=生成-ID(密鑰(」 cityNames」 城市)1])] 「它說,這將找到的鍵值中的每個城市的第一個也是唯一的第一個(因此唯一的)。創建一組所有城市的獨特價值。這給上面的XML將返回「雅閣Broxton卡特勒Fenmore帕多瓦Stratmore Oseola」 (注意,沒有倍數)。
現在,我的問題是這樣的:爲什麼第二個語句返回,而不只是一個值的範圍,?
感謝
我編輯我的問題的更好的理解,請再看看它,讓我知道你在想什麼。謝謝。 – 2009-12-12 15:38:36