Write the same xml elements from different files only once in output file with XSLT



I have several xml files that all have certain elements in common and some elemtens exclusive to them. I need to output the value of those elements only once to another xml-document using xslt. What's the best way to do that?


Example:


file a.xml



<someelement>Value</someelement>
<aelement>value</aelement>


file b.xml



<someelement>Value</someelement>
<belement>value</belement>


file c.xml



<someelement>Value</someelement>
<celement>value</celement>


Output.xml



<someelement>Value</someelement>
<aelement>value</aelement>
<belement>value</belement>
<celement>value</celement>


I iterate over a file containing all the paths of the xml files in the folders and subfolders and I access the elements with the doc function.


However, at the moment, the common elements appear several times in the output document.


Is that possible with xslt 2.0, using Saxon9he?


Thanks for help and tips!


No comments:

Post a Comment