我有以下图表:
<?xml version="1.0" encoding="utf-8"?><graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph edgedefault="undirected">
<node id="a">
<data key="d0">some info</data>
</node>
<node id="b"/>
<node id="c">
<data key="d0">some more info</data>
</node>
<node id="d"/>
<edge source="a" target="b"/>
<edge source="a" target="c"/>
<edge source="b" target="c"/>
<edge source="b" target="d"/>
<edge source="c" target="d"/>
</graph>
</graphml>
而且我正在尝试使用 XSLT 创建包含所有节点的图形子集相邻节点a
。
期望的输出:
<?xml version="1.0" encoding="utf-8"?><graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph edgedefault="undirected">
<node id="b"/>
<node id="c">
<data key="d0">some more info</data>
</node>
<edge source="b" target="c"/>
</graph>
</graphml>
我不是 XSLT 的真正专家,但可以分步进行吗?即首先删除有问题的边缘,然后删除无邻居节点?