File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Create  XML Document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Create  XML Document" Watch "Create  XML Document" New topic

Create XML Document

sandy yang

Joined: Jan 26, 2001
Posts: 8
Hi friends,
My question is how to create an xml document. I know I can use the notepad and just type in:

<?xml version="1.0" ?>
- <CD>
<TITLE>Empire Burlesque</TITLE>
- <CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
- <CD>
<TITLE>Greatest Hits</TITLE>
<ARTIST>Dolly Parton</ARTIST>
- <CD>
<TITLE>The dock of the bay</TITLE>
<ARTIST>Otis Redding</ARTIST>
- <CD>
<TITLE>Picture book</TITLE>
- <CD>
<ARTIST>The Communards</ARTIST>
- <CD>
<TITLE>Unchain my heart</TITLE>

But what is I has a hunderd CD? I just don't want type one by one, I also don't want copy/paste. Can I write a java program to create a user interface input the CD content and how I put the content in the XML document?
Thanks for the help!
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
Since an XML document is based on ASCII text, you can use any text editor to create XML documents. There are several advanced XML-compliant editors which are intelligent enough to validate the document as you keep typing! Checkout
For creating large XML documents it is not uncommon to use custom-written 4GL applications. For example, you could write a Java program that reads 100 records from the database and generates an XML document comprising of those records. These days major database vendors support autogeneration of XML resultsets.
Hope that helps!
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: Create XML Document
It's not a secret anymore!