Adding XML data at specific location

poldesenuoutt

New Member
I have a very large XML data that should be loaded everytime the program starts.\[code\]<Calculation> <CalcGroup TypeOfGroup="GeneralInfo"> <Parameter Name="name"></Parameter> </CalcGroup> <EnvironmetData> <EnvDataGroup Id="1"> <Parameter Name="Lastname"/> </EnvDataGroup> </EnvironmentData> <ComponentData> <Component TypeofComponent="Piston" ID="1"> <ComponentCatagory="Values"> <Parameter Name ="Temprature"></Parameter> </ComponentCatagory> </Component> </ComponentData></Calculation>\[/code\]how to load the default XML ? and add or delete items in my project?Whenever I tried to add an element for ex.\[code\] Component com = new Componet(); com.setTypeofComponent=("Piston"); com.setID(BigInteger.valueof(2)); ComponentData.getcomponet().add(com);\[/code\]And i found this component added at the end of the XML file, whereas I need it just in the pistion catagory. fyi, I used jaxb to generate the property methods. And I am using this xml inside a java code. Thanks for your help.
 
Back
Top