I have a very unique use case. Here are the details:
1. There is an xml file which has several (200) attributes. For example, datasource.xml and there are two attributes in it called:
2. The above xml file exists across all environments i.e. Preprod, Prod, QA, Dev, Support etc.
3. Every environment has a custom property class and each server within an environment will have its own instance of the custom property class. These instances will contain the values for all attributes that are part of the xml file. For example,
Under Prod class, there are two custom property instances Prod1 and Prod2.
Prod1 will have a value for DRIVER property and a value for INSTANCE property
Prod2 will have a value for DRIVER property and a value for INSTANCE property.
4. The requirement is to read the values of properties from custom instances, populate the xml file and deploy it to that server i.e. for Prod1, read DRIVER value and INSTANCE value from Prod1`s custom property instance, populate the xml file and deploy it to a certain location in Prod1.
Any ideas how to accomplish this?
I did this very thing at a customer of ours a couple of summers ago. Take an OOP methodology to it. If you utilize a class/sub-class and interface approach, it makes the xml generation easy.