> Hello everyone,
>
[quoted text clipped - 10 lines]
> Oracle database. Can someone please tell me how to go about doing
> this?
Query the database, and based on the values you get, emit the
appropriate XML data to a file. This can be as simple as using a FileWriter,
or it could involve using Castor or some other XML manipulation library to
construct an in-memory representation of the document, and serializing it to
disk.
- Oliver
Monica - 01 Jun 2006 19:02 GMT
> Query the database, and based on the values you get, emit the
> appropriate XML data to a file. This can be as simple as using a FileWriter,
[quoted text clipped - 3 lines]
>
> - Oliver
Thank you for responding to my post.
Could you please explain how to go about doing what you suggest (emit
the appropriate XML data to a file)? This is what I don't understand
how to do.
Thanks.
Oliver Wong - 02 Jun 2006 14:51 GMT
>> Query the database, and based on the values you get, emit the
>> appropriate XML data to a file. This can be as simple as using a
[quoted text clipped - 12 lines]
> the appropriate XML data to a file)? This is what I don't understand
> how to do.
Let's say you want to emit the file with the contents: <foo>Hello
world!</foo>
You can do this by writting the following JavaCode:
[CODE BEGIN]
//put the appropriate imports
FileWriter fw = new FileWriter("output.xml");
PrintWriter pw = new PrintWriter(fw);
pw.println("<foo>Hello world!</foo>");
[/CODE END]
Let's say you want the contents in the foo tag to vary based on the
contents of the string variable bar. Then you'd write:
[CODE BEGIN]
//put the appropriate imports
String bar = "Hello World!";
FileWriter fw = new FileWriter("output.xml");
PrintWriter pw = new PrintWriter(fw);
pw.println("<foo>" + bar + "</foo>");
[/CODE END]
- Oliver
Monica - 02 Jun 2006 16:30 GMT
> Let's say you want to emit the file with the contents: <foo>Hello
> world!</foo>
[quoted text clipped - 22 lines]
>
> - Oliver
Thank you for explaining. I will give this a try.
Monica