hi all,
I am trying to create a
java program which will take an SOAP/XML input format and generate xml of my own format...
i am new to xml technologies so totally confused what to do...
I am trying to look for some sample code which does the same.
do i need to use any parsers like SAX / DOM ?
What i am actually looking at is :
when the user input comes to me as xml file, i want to capture each tag value and store it as attribute value in my output xml. i.e; in my output what i have is a single tag with many attributes
if sample input file:
<soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
</soap-env:Header>
<soap-env:Body CLASS_TYPE="Request">
<Query>
<name>prabhu</name>
<Address1>#123</Address1>
<Address2></Address2>
<Address3></Address3>
<CityName>hyd</CityName>
<StateCode>ap</StateCode>
<StateName></StateName>
<CountryCode>IND</CountryCode>
<PostalCode>123456</PostalCode>
<CountryName>INDIA</CountryName>
<LastName></LastName>
<FirstName></FirstName>
</Query>
</soap-env:Body>
</soap-env:Envelope>
then, the sample output would be :
<user
name_1="prabhu"
address_1="#123"
address_2=""
address_3=""
city="hyd"
state_name=""
state_code="AP"
postal_code="123456"
ctry_name="India"
ctry_code="IND"
/>
Pls, help me on this ...
Thanks in advance.