<Request xmlns:ns0="http://Request">
<Lines>
<Line>
<requestid>76</requestid>
<Code>C001</Code>
</Line>
<Line>
<requestid>77</requestid>
<Code>C002</Code>
</Line>
</Lines>
<Conflict>
<responseid>76</responseid>
<responsecode>WB</responsecode>
<cService>
<responseid>73</responseid>
<responsecode>HA</responsecode>
</cService>
<cService>
<responseid>7600</responseid>
<serviceCode>PP</serviceCode>
</cService>
</Conflict>
<Conflict>
<responseid>77</responseid>
<responsecode>WB7</responsecode>
<cService>
<responseid>745</responseid>
<responsecode>HAQ</responsecode>
</cService>
<cService>
<responseid>7234</responseid>
<serviceCode>PP</serviceCode>
</cService>
</Conflict>
<Conflict>
<responseid>77</responseid>
<responsecode>WBC</responsecode>
<cService>
<responseid>72341</responseid>
<responsecode>HAC</responsecode>
</cService>
<cService>
<responseid>98</responseid>
<responsecode>PPC</responsecode>
</cService>
</Conflict>
</Request>
所需的输出应如下所示。
<Output xmlns:ns0="http://Response">
<Lines>
<Line>
<responseid>76</responseid>
<code>WB</code>
<Features>
<ExistingFeature>
<responseid>76</responseid>
<CFeature>
<responseid>76</responseid>
</CFeature>
<CFeature>
<responseid>76</responseid>
</CFeature>
</ExistingFeature>
</Features>
</Line>
<Line>
<Num>77</Num>
<Features>
<ExistingFeature>
<responseid>77</responseid>
<code>WB7</code>
<CFeature>
<responseid>77</responseid>
</CFeature>
<CFeature>
<responseid>77</responseid>
</CFeature>
<CFeature>
<responseid>77</responseid>
</CFeature>
<CFeature>
<responseid>77</responseid>
</CFeature>
</ExistingFeature>
</Features>
</Line>
</Lines>
</Output>
那么您能否帮助我在 XSLT 中实现这一目标。因为我正在尝试多种方式,但由于我在 xslt 方面很差,所以无法做到。
设想。实际上应该为输入中的每一行创建一行,并且基于 requestID(即 76 或 77)的输入中的每一行都有一个或多个冲突。因此,对于输入中每次出现的行以及输入中所有相应的匹配冲突,我必须根据输出中的单个节点中的这些 ID 对冲突进行分组。
所以你能帮我为这个场景写 xslt 吗?