Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to create xml using jaxp - java?

Posted on 2008-06-12
10
Medium Priority
?
1,530 Views
Last Modified: 2013-11-23
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>
0
Comment
Question by:inditrozen
  • 5
  • 5
10 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 21767695
From what do you want to create it?
0
 

Author Comment

by:inditrozen
ID: 21767714
Actually I am taking xml element information from database.
0
 

Author Comment

by:inditrozen
ID: 21767769
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
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 86

Expert Comment

by:CEHJ
ID: 21767800
What db are you using?
0
 

Author Comment

by:inditrozen
ID: 21767873
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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21767960
If you have Java objects you'd probably be better off using something like XStream
0
 

Author Comment

by:inditrozen
ID: 21767994
Ya, I have java objects..
can you please suggest some good tutorial for XStream or some sample program .

thx..
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 750 total points
ID: 21768085
XStream is pretty simple and well documented with samples in the download

http://xstream.codehaus.org/
0
 

Author Comment

by:inditrozen
ID: 21768156
thanks a lot
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21768240
:-)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question