hi all i want to create an xml file from an array
i've been googling but can't find the right one
the closest one that i get is in http://www.higherpass.com/java/Tutorials/Building-Xml-With-Java-And-Dom/
but it doesn't create an xml file like i wanted to
i want to print and create it like c:\xml file\data.xml

can anybody show me the code or any link that actually print like how i wanted?
any help would be appreciated, thanx :)

hat actually print like how i wanted?

Can you explain "how I wanted"?

The site at your link has code to generate Strings of XML and print them on the screen.
Have you tried replacing the 'print to screen' method calls with classes and methods that will write the Strings to a file?

sorry if my explanation not clear
it's just a simple xml like

<?xml version="1.0"?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<item>
    <id></id>
    <name></name>
</item>
<item>
    etc
</item>
</data>

and yes what i need is how to write string into file that is xml :)
any references while i keep looking and trying?

Edited 6 Years Ago by 1x4n: n/a

how to write string into file

There are plenty of examples of how to do that.
Try Searching for PrintWriter for sample codes that write Strings to files.

thanx a lot NormR1 i've got the solution
may i ask again?
which one is faster for writing strings to file
is it using bufferedWriter or PrintWriter?
or there is another method coz i only found this two solution

i want to parse a large dataset which i process from java into php for presentation
which one is faster to read
is it from text, xml, or database?

sorry if i was asking too much and out of topic because i'm a newbie
i've only tried it on a small dataset and can't see the differences...

Edited 6 Years Ago by 1x4n: n/a

which one is faster

Don't worry about it yet.
If your really interested write some test programs and time them using the System.currentTimeMillis() method at start and end of job.

thanx you are a great help NormR1
i wonder when are u sleeping coz your answer is really fast :)
GBU

Edited 6 Years Ago by 1x4n: n/a

This question has already been answered. Start a new discussion instead.