inditrozen
asked on
How to create xml using jaxp - java?
Hi Experts,
how can I create xml file using jaxp ?
sample xml file :
<?xml version="1.0"?>
<country name="xyz">
<cities>
<city name="Test1" id="1">
<address >
<street>str</street>
<number>1</number>
</address>
</datapoint>
<city name="Test2" id="2">
<address>
<street>str1</street>
<number>2</number>
</address>
</city>
</cities>
</country>
how can I create xml file using jaxp ?
sample xml file :
<?xml version="1.0"?>
<country name="xyz">
<cities>
<city name="Test1" id="1">
<address >
<street>str</street>
<number>1</number>
</address>
</datapoint>
<city name="Test2" id="2">
<address>
<street>str1</street>
<number>2</number>
</address>
</city>
</cities>
</country>
From what do you want to create it?
ASKER
Actually I am taking xml element information from database.
ASKER
I am looking at the tutorial on http://www.javazoom.net/services/newsletter/xmlgeneration.html
(5) - JAXP + SAX + Serialization to servlet output stream : JDK 1.4 compliant -
but I dont get it completely that how can I add child elements
(5) - JAXP + SAX + Serialization to servlet output stream : JDK 1.4 compliant -
but I dont get it completely that how can I add child elements
What db are you using?
ASKER
I think ,I asked in a wrong way, sorry for that.
I need to know how to use this jaxp.
say I have list of cities and all other is present in program.
I need to know how to use this jaxp.
say I have list of cities and all other is present in program.
If you have Java objects you'd probably be better off using something like XStream
ASKER
Ya, I have java objects..
can you please suggest some good tutorial for XStream or some sample program .
thx..
can you please suggest some good tutorial for XStream or some sample program .
thx..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks a lot
:-)