我想按字母顺序显示州名和国家名。如果有任何与 state 关联的county1 节点,我需要显示所有带有国家名称的州。但是,如果没有以某个字母开头的州,例如“X”,那么它不应该显示为 empty 。我很确定 xslt 可以做到这一点,但不知道如何去做。所以你们那里的大师,pleeeeeeeease帮助我。我正在使用visaul stuido2010 xml编辑器和xslt1.0 ..我无法更改xslt版本..我在这里被击中..
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