我正在尝试使用 XSL 对 XML 元素进行排序,类似于这篇文章: How to sort some XML elements based on their dependencies, by using XSLT? ,但在我的情况下,我有以下 xml:
<root>
<element name="a" predecessor="x">
<children>
<element name="b" predecessor="c"/>
<element name="c" predecessor="a"/>
<element name="d" predecessor="b"/>
</children>
</element>
</root>
预期的输出将是:
<root>
<element name="a" predecessor="x">
<children>
<element name="c" predecessor="a"/>
<element name="b" predecessor="c"/>
<element name="d" predecessor="b"/>
</children>
</element>
</root>
你能帮我实现这一目标吗?