【发布时间】:2015-11-15 09:21:50
【问题描述】:
假设每个第一个“Section”->“typeAttr”都是第二个的子项(A 是父项,B 是子项),当然它们与其他“类型”相关。如何使用 xsl 并将其转换为 html?
<root>
<Type>
<Section typeAttr="B"/>
<Section typeAttr="A"/>
</Type>
<Type>
<Section typeAttr="C"/>
<Section typeAttr="B"/>
</Type>
<Type>
<Section typeAttr="D"/>
<Section typeAttr="B"/>
</Type>
<Type>
<Section typeAttr="E"/>
<Section typeAttr="C"/>
</Type>
</root>
类似这样的:
<ol>
<li>
<a>A</a>
<ol>
<li>
<a>B</a>
<ol>
<li><a>C</a>
<ol>
<li>
<a>E</a>
</li>
</ol>
</li>
<li>
<a>D</a>
</li>
</ol>
</li>
</ol>
</li>
</ol>
【问题讨论】: