473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Easiest way to create an XML document from a Data List

dlite922
1,584 Expert 1GB
I'm looking around the web to find a quick little library to make writing to XML quick, clean and painless.

I'm getting confused by all the different options (JDOM, SAX, etc..)

My question is, do you know of a class or library (as close as possible to native java libraries, e.g. no huge library import) that i could use with the below pseudo code?

Expand|Select|Wrap|Line Numbers
  1.  
  2. // open document
  3. SomeLibrary X = new SomeLibrary('myNewfile.xml'); 
  4. X.addDTD('my.dtd'); 
  5. X.addRoot('my_root_element'); 
  6.  
  7. forloop mydata {
  8.    Eelment E = X.addElement('myElement'); 
  9.    E.addAttribute('foo',myData[i].getFoo()); 
  10.    E.addNode('child',myData[i].getChild());
  11. }
  12.  
  13. // write and close
  14. X.write(); 
  15. X.close();
  16.  
  17.  
Thanks for any suggestions and pointers. I'm looking into JDOM, but want to hear your advice first.

Dan
Dec 14 '10 #1
1 1800
Dheeraj Joshi
1,123 Expert 1GB
I suggest you go with XML parser provided by JAVA under javax package.

Regards
Dheeraj Joshi
Dec 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve | last post by:
Can anyone tell me how to retrieve the embedded document data (author, owner, status, etc) from a Word file. Thanks! Steve
0
by: Dica | last post by:
i'm just trying out c# and VS 2003 for the first time and i'm running into an error: "Cannot create a child list for field tblProjects" the section of code that seems to be throwing this is:...
0
by: Winterminute | last post by:
I am binding the results of a database query to a DataList using the following code: SqlDataAdapter myCommand = new SqlDataAdapter("SELECT * FROM _Hardware_Configurations", myConnection);...
2
by: Steve Lloyd | last post by:
Hi there, I have a set of products each of which has attributes (color size etc), is it possible to use a data list or repeator to display all the items and provide combo box with a unique set...
1
by: Shahid Saleem | last post by:
Dear Members I want to generate a Template using DataList and i want to user Grid control in the item template, is it possible. if yes need some explanation regarding data binding of grid...
1
by: Agnes | last post by:
Please be kind to take a look dsSeaInvInfo.Clear() daSeaInvInfo.SelectCommand = New SqlCommand daSeaInvInfo.SelectCommand.Connection = conSea daSeaInvInfo.TableMappings.Add("Table",...
0
ADezii
by: ADezii | last post by:
Rather than using CurrentProject.Connection or entering your own Connection information, ADO supports storing Connection information in an external file called a Data Link File (which normally has a...
0
by: rishibsr | last post by:
Dear All, How to complete the data list with blanks column in asp.net Total Database Records = 7 Data List Property RepeatColumns="3" RepeatDirection="Horizontal"
1
Jezternz
by: Jezternz | last post by:
Scriptaculous needs an official forum but does not have one so I am asking here :). note you will need to be familiar with scriptaculous to help me here. Basicly I have a script that has a...
0
by: Ed Dror | last post by:
Hi there, I'm using Wisual Studio 2005 Pro with SQL server 2005 Dev on XP SP2 I have two tables Generic Item table (GN_ID) PK Color Table (Color_ID) PK and GN_ID FK very simple one to many...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.