我有一个 XML 数据文档,其中包含名为“folio”的嵌套标签。这种嵌套标签的最大级别是 4。我需要递归处理每个作品集,直到达到没有嵌套作品集的级别并打印内容。
我不确定如何在 XSL 中进行递归。这是一个示例文档。有人可以帮忙吗?
谢谢。
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<reporting:root xmlns:reporting="http://www.xyzcorp.net/reporting">
<reporting:default0 reporting:type="Portfolio">
<reporting:header>
<reporting:configuration>
<reporting:columns>
<reporting:column reporting:group="instrument" reporting:name="Ident" reporting:tag="ident" reporting:type="int"/>
<reporting:column reporting:group="prices" reporting:name="Last (Time)" reporting:tag="lastTime" reporting:type="string"/>
<reporting:column reporting:group="noGroup" reporting:name="RIC" reporting:tag="ric" reporting:type="string"/>
<reporting:column reporting:group="instrument" reporting:name="Reference" reporting:tag="reference" reporting:type="string"/>
<reporting:column reporting:group="result" reporting:name="Currency" reporting:tag="currency" reporting:type="string"/>
</reporting:columns>
</reporting:configuration>
</reporting:header>
<reporting:window reporting:Id="36674" reporting:level="0" reporting:name="MY_PORTFOLIO" reporting:parentId="11991">
<reporting:folio>
<reporting:folioid>1234</reporting:folioid>
<reporting:folio>
<reporting:folioid>9876</reporting:folioid>
<reporting:line reporting:Id="67520135" reporting:level="1" reporting:name="INTERNATIONAL BUSINESS MACHINES CORP" reporting:parentId="36674" reporting:positionType="0">
<reporting:ident>643633</reporting:ident>
<reporting:reference>IBM.USD</reporting:reference>
<reporting:currency>USD</reporting:currency>
</reporting:line>
<reporting:line reporting:Id="67520179" reporting:level="1" reporting:name="GENERAL ELECTRIC CO" reporting:parentId="36674" reporting:positionType="0">
<reporting:ident>643635</reporting:ident>
<reporting:ric>GE.N</reporting:ric>
<reporting:reference>GE.USD</reporting:reference>
<reporting:currency>USD</reporting:currency>
</reporting:line>
</reporting:folio>
</reporting:folio>
</reporting:window>
</reporting:default0>
</reporting:root>