XSLT complex copy

Wednesday, November 4, 2015

I would like to copy an XML file with a XSL sheet. By copying I want "anonymize" my XML file, taking some elements of the XML as a variable.



Base:



<?xml version="1.0" encoding="ISO-8859-15"?>
<root>
<top>
<nbpeople>2</nbpeople>
</top>
<people>
<id>45</id>
<name>MARTIN</name>
<firstname>JEAN</firstname>
</people>
<people>
<id>98</id>
<name>DUPONT</name>
<firstname>Yves</firstname>
</people>
</root>


result:



<?xml version="1.0" encoding="ISO-8859-15"?>
<root>
<top>
<nbpeople>2</nbpeople>
</top>
<people>
<id>45</id>
<name>people 45</name>
<firstname>JEAN</firstname>
</people>
<people>
<id>98</id>
<name>people 98</name>
<firstname>Yves</firstname>
</people>
</root>


My real XML file is obviously more complex.
Thank's

0 comments:

Post a Comment