如何过滤XML标记的重复组合

时间:2016-01-07 09:30:55

标签: xml xslt

我有一个问题取决于xml文件。 下面是我的xml代码的示例。 我想要过滤的内容如下: 标记值'csvconstituentPartNumber'只能与标记值'csvassemblyPartNumber'一起出现一次。因此,这并不意味着'csvconstituentPartNumber'在整个文件中可能不会出现多次,但不会与'csvassemblyPartNumber'的值结合使用。

在代码中是一个例子: 块1具有'csvassemblyPartNumber'0000006710与'csvconstituentPartNumber'0000001399的组合。此组合0000006710与0000001399可能仅在孔XML文件中出现一次。 块2和3包含相同的标记值组合。 “csvassemblyPartNumber”0000006710,带有“csvconstituentPartNumber”0000001537。这是不允许的。所以我正在搜索一个xsl代码,找到那些重复的组合,我可以在Internet Explorer中运行。

希望有人可以帮助我!

<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX24.dtd">
<NmLoader>

<csvBeginOccurrencedAssemblyAdd handler="wt.part.LoadPart.beginOccurrencedAssemblyAdd" >
<csvassemblyPartNumber>0000006710</csvassemblyPartNumber>
<csvassemblyPartVersion>A</csvassemblyPartVersion>
<csvconstituentPartNumber>0000001399</csvconstituentPartNumber>
<csvconstituentPartQty>0.7100000</csvconstituentPartQty>
<csvconstituentPartUnit>m</csvconstituentPartUnit>
</csvBeginOccurrencedAssemblyAdd>
<csvEndOccurrencedAssemblyAdd handler="wt.part.LoadPart.endOccurrencedAssemblyAdd"/>

<csvBeginOccurrencedAssemblyAdd handler="wt.part.LoadPart.beginOccurrencedAssemblyAdd" >
<csvassemblyPartNumber>0000006710</csvassemblyPartNumber>
<csvassemblyPartVersion>A</csvassemblyPartVersion>
<csvconstituentPartNumber>0000001537</csvconstituentPartNumber>
<csvconstituentPartQty>1</csvconstituentPartQty>
<csvconstituentPartUnit>ea</csvconstituentPartUnit>
</csvBeginOccurrencedAssemblyAdd>
<csvEndOccurrencedAssemblyAdd handler="wt.part.LoadPart.endOccurrencedAssemblyAdd"/>

<csvBeginOccurrencedAssemblyAdd handler="wt.part.LoadPart.beginOccurrencedAssemblyAdd" >
<csvassemblyPartNumber>0000006710</csvassemblyPartNumber>
<csvassemblyPartVersion>A</csvassemblyPartVersion>
<csvconstituentPartNumber>0000001537</csvconstituentPartNumber>
<csvconstituentPartQty>5</csvconstituentPartQty>
<csvconstituentPartUnit>m</csvconstituentPartUnit>
</csvBeginOccurrencedAssemblyAdd>
<csvEndOccurrencedAssemblyAdd handler="wt.part.LoadPart.endOccurrencedAssemblyAdd"/>

</NmLoader>

0 个答案:

没有答案