Change in XML format

  • Thread starter Thread starter ipramod
  • Start date Start date
I

ipramod

Hi,

I have an predefined XML format, lets say:


<employee id="1111">
<name></name>
<addr></addr>
<salary></salary>
</employee>


Now if my XML format is changed then how do I convert my old XML to
new XML? Some tags are added in the XML tag of employee and some are
deleted, some are as it is. But the new format is also fixed and I
know that.


Is there any standard way like XSLT or any other way to convert them?
I dont want to manually change the XML tags. Do I have to parse each
node and check whether it is present in the new format or modify it
accordingly.


I just want the same data to be filled in as per my new XML format.


Please let us know if any coding standard is followed to the same.


Thanks,
Regards,
PI
 
I have an predefined XML format, lets say:

<employee id="1111">
<name></name>
<addr></addr>
<salary></salary>
</employee>

Now if my XML format is changed then how do I convert my old XML to
new XML? Some tags are added in the XML tag of employee and some are
deleted, some are as it is. But the new format is also fixed and I
know that.

Is there any standard way like XSLT or any other way to convert them?

Yes, XSLT is basically the standard way of doing this.
I dont want to manually change the XML tags. Do I have to parse each
node and check whether it is present in the new format or modify it
accordingly.

"Just" write an XSLT template and apply it to the old files.

I say "just" because I personally can't standard XSLT. However, it's
probably the most appropriate technology in this case. See
http://w3schools.com/xsl/default.asp

Jon
 
Back
Top