這裏XML數據是XML我想使用XSL轉換到下面的結果。任何幫助please.This有點像Windows目錄結構。這裏的目錄深度是動態的。分組使用XSL
<?xml version="1.0" encoding="UTF-8"?>
<root>
<qc name="accounting" level="1">
<qc name="fund" level="2">
<qc name="v1_0" level="3"/>
</qc>
</qc>
<qc name="asset_allocation" level="1">
<qc name="fund" level="2">
<qc name="v1_0" level="3"/>
</qc>
</qc>
<qc name="asset_allocation" level="1">
<qc name="fund" level="2">
<qc name="v1_1" level="3"/>
</qc>
</qc>
<qc name="credit_quality" level="1">
<qc name="account" level="2">
<qc name="v1_0" level="3"/>
</qc>
</qc>
<qc name="credit_quality" level="1">
<qc name="fund" level="2">
<qc name="v1_0" level="3"/>
</qc>
</qc>
<qc name="credit_quality" level="1">
<qc name="v1_0" level="2"/>
</qc>
<qc name="credit_quality" level="1">
<qc name="v2_0" level="2"/>
</qc>
<qc name="portfolio" level="1">
<qc name="credit_quality" level="2">
<qc name="v1_0" level="3"/>
</qc>
</qc>
</root>
在上面的XML我有每個級別的名稱。我想在相同的級別分組相同的名稱。
結果:
<root>
<qc name="accounting" level="1">
<qc name="fund" level="2">
<qc name="v1_0" level="3"/>
</qc>
</qc>
<qc name="asset_allocation" level="1">
<qc name="fund" level="2">
<qc name="v1_0" level="3"/>
<qc name="v1_1" level="3"/>
</qc>
</qc>
<qc name="credit_quality" level="1">
<qc name="account" level="2">
<qc name="v1_0" level="3"/>
</qc>
<qc name="fund" level="2">
<qc name="v1_0" level="3"/>
</qc>
<qc name="v1_0" level="2"/>
<qc name="v2_0" level="2"/>
</qc>
<qc name="portfolio" level="1">
<qc name="credit_quality" level="2">
<qc name="v1_0" level="3"/>
</qc>
</qc>
</root>
那麼,就是你有這麼遠的XSL? – Torious 2012-04-20 21:58:38