我想按字母順序顯示狀態和國家名稱。 如果有任何與縣名相關的縣節點,我需要在州名中顯示所有 州。但是,如果沒有以 開頭的州的某個字母表,例如說「X」,那麼它不應顯示爲空。 我很確定這是可能的與xslt,但不知道如何去做這件事。 所以你大師在那裏,pleeeeeeease幫助我,我現在用的VISAUL stuido2010 XML編輯器和xslt1.0 .. 我沒有辦法改變XSLT version..I來到這裏打..使用xslt1.0排序節點數據字母順序
My Input xml Looka like below :
<?xml version="1.0" encoding="utf-8" ?>
<countries>
<country>
<state>Ontario</state>
<country1>CANADA</country1>
</country>
<country>
<state>Swindon</state>
</country>
<country>
<state>CAMDEN</state>
</country>
<country>
<state>NJ</state>
<country1>America</country1>
</country>
<country>
<state>NJ</state>
<country1>America</country1>
</country>
<country>
<state>NY</state>
<country1>America</country1>
</country>
<country>
<state>DE</state>
<country1>America</country1>
</country>
<country>
<state>Queenland</state>
<country1>Australia</country1>
</country>
<country>
<state>APstate</state>
</country>
<country>
<state>ANstate</state>
</country>
</countries>
我輸出如下所示:
A
America
- DE
- NJ
- NY
ANstate
APstate
Australia
-Queenland
C
CAMDEN
CANADA
-Ontario
S
Swindon
的[在XML字母順序排序的數據(http://stackoverflow.com/questions/17845199/sort-data-in-the-xml-alphabetical-order) –