Use XSLT to filter source XML to destination XML



Due to a production issue a bunch of data was corrupted. The good news is that I have all the data in an XML file which happens to be in the same format as the input to submit data changes. The problem I have is one record takes a while to process. My "clean master" has >20,000 records, and only 530 have been corrupted. I have a key field to identify the record I want to include in my destination. How can I include in an XSLT to output a node only if it is in a list I specify? I do not care if I hard-code the list in the XSLT.



<recordSet>
<record>
<key>123</key>
<val1>abc</val1>
<val2>def</val2>
</record>
<record>
<key>456</key>
<val1>hij</val1>
<val2>klm</val2>
</record>
<record>
<key>789</key>
<val1>nop</val1>
<val2>qrs</val2>
</record>
</recordSet>


Let's say I only want records with key 123 and key 789. Thank you.


No comments:

Post a Comment