I am aware that we have a schem.xsd for generic package content.xml creation and neither do vault.xml and other associated xml files in the META-INF folder of the package.
I want to know if there is some recommended approach to build the package and xml files, specifically content.xml programmatically on the file system. I know that we can use package manager (API not the GUI/screen) but that comes into picture when the folder structure and xmls files are created. I am interested to know a standard procedure of acceptable procedures to build the structure. I have seen folks use JDom/SAX etc to build this and even velocity to try it out using templates but that looks largely as a workaround. Can anyone help with some inputs on this?
We've been successful at using ANT as a Build tool to run XSLT 2.0 using the Saxon XSL processor. We have processed both CSV and XML files into packages. This started out pretty simply, but grew more complex than initially thought. There are a lot of subtlties that can be overlooked in the package format. Also if your filters aren't right it will happily delete a lot of data. Thankfully it appears uninstalling can recover these most times, but I'd recommend testing packages on a throw away instance.
I've posted an example Ant + XSL that goes from CSV > XML > Many XML Files > CRX Package Zip: https://github.com/odu/crx-package-xsl-example. There is also some info on some of the complexities of a package mentioned on that page that may be helpful, even if Ant / XSL isn't your route.
Can you share more about your use for building a package, what format is the source data in, etc? This example is really only useful for batch loading.