on 11-06-2008 11:03 AM
Hi,
I have a requirement in which I need to convert the data from XML file to string.
E.g.
<Drawing>
<DrawingSpecification>
<Header>
<SoldTo>SDN</SoldTo>
<SoldToName>SAP</SoldToName>
<Date/>
<Manager>CEO</Manager>
< Plant>INDIA</Name>
<Items>
<Item>
< MaterialNumber>MatNum12</ MaterialNumber>
<ProductNumber>ProName12</ ProductNumber>
</Item>
</Items>
< ClientId>ClientID123</ ClientId>
<FileName>FileName123</FileName>
<Type/>
< TemplateName/>
</DrawingSpecification>
<Image contentType=""/>
< /Drawing>
Output should be like:
< File>
< Content> SDN SAP CEO INDIA MatNum12 ProName12 ClientID123 FileName123</Content>
< /File>
Please provide solution for the same.
Thanks,
Abhishek.
Hi,
You can use DOM Parser for this. Check these links.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM3.html
http://www.developerfusion.com/code/2064/a-simple-way-to-read-an-xml-file-in-java/
Once the string is obtained, you can create the output file.
Regards,
Harini S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.