The construction of the file structure and the finalization
The final step of the script takes care of all the folder hierarchy the Hdoc file has to be wrapped in. This step is in fact very simple : it creates the necessary OPT and META-INF folders and the mimetype file in the out directory, copies the content.xml file generated by the XSLT in the out folder and zips the out folder. Your hdoc file is ready !