I am writing an application that updates parts of an existing file based on the set of files in a directory Will happen. An example of this XML file can be seen below:
A list of files is added to the scope of the below and if they should be "purble" (parameter replacement ):
& lt; Pack & gt; & Lt; Pack name = "main application" required = "yes" installGroups = "new application" & gt; & Lt; File src = "post-install-taskss.bat" targetdir = "$ INSTALL_PATH" / & gt; & Lt; File src = "build.xml" targetdir = "$ INSTALL_PATH" / & gt; & Lt; Reciprocal goal file = "$ INSTALL_PATH / post-install-taskss.bat" /> & Lt; Purse qualified target = "$ INSTALL_PATH / build.xml" /> & Lt; / Pack & gt; & Lt; / Pack & gt;
Now the number of files to be added in this scope can be run application every time. To make this possible, I have considered the following approach:
1) Read the entire xml in org.w3c.dom. *; By reading the directory, add documents and nodes based on the result.
2) Add the content from the .properties file in any way to the scope of the scope. This way it is possible to update the file again without the skeleton.
3) ??
Any suggestions on a good approach to this kind of work?
If there is a chance that your XML configuration may be of significant size, it is actually a DOM Based approach is not good [due to the related memory footprint of loading a large XML document]
You should take a look that it has a highly customized approach to parse and write XML documents is.
Comments
Post a Comment