私はXSLT/Xqueryを使い慣れておらず、2つのxmlファイル(データの内容は空白とコメントを無視できます)を比較し、2番目のxmlの変更されたノードを出力したいと考えています。私の知る限り(グーグル)私はそれがXqueryを使用して行うことができると信じています。私のXMLは以下のようになります。xqueryを使ったXMLの比較
<ns:Batch xmlns:ns="http://www.sample.com/">
<ns:Product>
<ns:productId>AB02921</ns:productId>
<ns:type>Product</ns:type>
<ns:productDescription>
<ns0:string xmlns:ns0="http://www.sample.com/core" country="US" language="en">EVE BOOTCUT JEAN</ns0:string>
</ns:productDescription>
<ns:productLongDescription>
<ns0:string xmlns:ns0="http://www.sample.com/core" country="US" language="en">For perennial cool with an uber comfortable tw...</ns0:string>
</ns:productLongDescription>
<ns:posDetails>
<ns:isTemplate>false</ns:isTemplate>
</ns:posDetails>
<ns:isTemplate>false</ns:isTemplate>
<ns:lastUpdated>2011-09-07T16:52:50.573</ns:lastUpdated>
<ns:exportDetails>
<ns:isTemplate>false</ns:isTemplate>
</ns:exportDetails>
<ns:mmGroupId groupTypeId="mmGroup" groupHierarchyId="ABC" variantGroupTypeId="region" variantGroupId="All" variantGroupHierarchyId="All">JSBFO</ns:mmGroupId>
<ns:inventoryDetails>
<ns:isTemplate>false</ns:isTemplate>
</ns:inventoryDetails>
<ns:productDimensions>
<ns:isTemplate>false</ns:isTemplate>
</ns:productDimensions>
<ns:warrantyDetails>
<ns:isTemplate>false</ns:isTemplate>
</ns:warrantyDetails>
<ns:standardCostPrice>0.0</ns:standardCostPrice>
<ns:standardMargin>0.0</ns:standardMargin>
<ns:colourId colourRangeId="Default">6007</ns:colourId>
<ns:sizeId sizeRangeId="Default">14</ns:sizeId>
<ns:styleId>AB029</ns:styleId>
</ns:Product>
これらの繰り返しノードのすべてと比較すると、このノード内の変更されたノードを返す必要があります。すべて同じことを私に助けてください。 よろしく、 Sri。
こんにちはDimitre、私は私の問題をよく理解していると私の要件は、同じXML構造を使用して2つのXMLファイル(データ比較)を比較していると思います。 – user823737
@ user823737:あなたは間違った答えの下にあなたのコメントを置くので、私はちょうど今偶然それを見た:)あなたはこの話題をちょっと読んでみる必要があります。とにかく、 'deep-equal()'はあなたが望むものになるかもしれません。私の答えを受け入れることを決めた場合、それは** 'deep-equal()'で終わるものです** :) –