我是Xslt的新手,我想处理具有两个相同节点但只有一个不同属性的XML。根据不同的属性输出应该在同一行有两个不同的列。 如果数据集ID具有8位数字它应该进入“集ID 1”列&如果它始于10位数字它应该去“集ID 2”列 这里开始是XML-XSLT将xml中的多个相同节点处理成一行
<?xml version="1.0" encoding="ISO-8859-1"?>
<DisplayDefinitionTable>
<columns>
<column_entry order_num="1">Name</column_entry>
<column_entry order_num="2">Id</column_entry>
<column_entry order_num="3">DatasetID</column_entry>
</columns>
<rows>
<row>
<object_tag tag="45106" uid="yfVhkbLv6Vq5bD"/>
<object_tag tag="45922" uid="BebdkpIm6Vq5bD"/>
<row_element column="1" component_tag="45925" property_name="name">DEM</row_element>
<row_element column="2" component_tag="45925" property_name="Id">8888431618</row_element>
<row_element column="3" component_tag="50853" property_name="DatasetID">31661449AA</row_element>
</row>
<row>
<object_tag tag="45106" uid="yfVhkbLv6Vq5bD"/>
<object_tag tag="45922" uid="BebdkpIm6Vq5bD"/>
<row_element column="1" component_tag="45925" property_name="name">DEM</row_element>
<row_element column="2" component_tag="45925" property_name="Id">8888431618</row_element>
<row_element column="3" component_tag="50854" property_name="DatasetID">8888431618A</row_element>
</row>
<row>
<object_tag tag="45175" uid="HReh0zDS6Vq5bD"/>
<object_tag tag="45922" uid="BebdkpIm6Vq5bD"/>
<row_element column="1" component_tag="51997" property_name="name">CEM</row_element>
<row_element column="2" component_tag="51997" property_name="Id">8888516207</row_element>
<row_element column="3" component_tag="52010" property_name="DatasetID">8888516207/C</row_element>
</row>
<row>
<object_tag tag="45175" uid="HReh0zDS6Vq5bD"/>
<object_tag tag="45922" uid="BebdkpIm6Vq5bD"/>
<row_element column="1" component_tag="51997" property_name="name">CEM</row_element>
<row_element column="2" component_tag="51997" property_name="Id">8888516207</row_element>
<row_element column="3" component_tag="52011" property_name="DatasetID">31661809AB</row_element>
</row>
<row>
<object_tag tag="44593" uid="07Uh0rzi6Vq5bD"/>
<object_tag tag="45922" uid="BebdkpIm6Vq5bD"/>
<row_element column="1" component_tag="52019" property_name="name">TT</row_element>
<row_element column="2" component_tag="52019" property_name="Id">8888574081</row_element>
<row_element column="3" component_tag="52992" property_name="DatasetID">8888574081/C</row_element>
</row>
<row>
<object_tag tag="44593" uid="07Uh0rzi6Vq5bD"/>
<object_tag tag="45922" uid="BebdkpIm6Vq5bD"/>
<row_element column="1" component_tag="52019" property_name="name">TT</row_element>
<row_element column="2" component_tag="52019" property_name="Id">8888574081</row_element>
<row_element column="3" component_tag="52993" property_name="DatasetID">31691071/AC</row_element>
</row>
</DisplayDefinitionTable>
我期待像
Name ID DatasetId1 DatasetId2
DEM 8888431618 31661449AA 8888431618A
CEM 8888516207 31661809AB 8888516207/C
请发表您的尝试,所以我们可以修复它,而不必写信给你r从头开始编写代码。 –
我试过下面的代码,但它给了两行: –
请不要尝试在评论中发布代码 - 而是编辑你的问题。 –