transforming one xml using source xml using xsltproc



probably a no brainer for the seasoned xslt experts among you but here goes: I have 2 xml files strings.xml and strings-es.xml I need to delete nodes that are in strings-es.xml but are not in strings.xml (the key is the name attribute) e.g.


strings.xml:



<Resources>
<!-- Strings for Dialog yes button -->
<string name="yes">"Yes"</string>

<!-- Strings for Dialog no button -->
<string name="no">"No"</string>

</Resources>


strings-es.xml



<Resources>
<!-- Strings for Dialog yes button -->
<string name="yes">"Si"</string>

<!-- Strings for Dialog no button -->
<string name="no">"Non"</string>

<!-- Strings not used -->
<string name="no">"blabla"</string>

</Resources>


desired output:



<Resources>
<!-- Strings for Dialog yes button -->
<string name="yes">"Si"</string>

<!-- Strings for Dialog no button -->
<string name="no">"Non"</string>


</Resources>

No comments:

Post a Comment