473,403 Members | 2,354 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,403 software developers and data experts.

reading an XML file into java

momotaro
357 100+
Hi,

I have an XML file that I want to read node by node in java.

if someone have any ideas please help.

thank's in advance.
Jul 11 '11 #1
3 2363
Dheeraj Joshi
1,123 Expert 1GB
XML reader class is available in Java.

See this API.
There are several other techniques also available, but usage depends on your need.

If you need a quick sample follow this link

Regards
Dheeraj Joshi
Jul 13 '11 #2
momotaro
357 100+
Thank's! while waiting for your answer I somehow managed to figure that out and now if it is not too much asking you again am looking for a way to create java class for each node based on what is in my XML file:

Expand|Select|Wrap|Line Numbers
  1. <ENTITY name="shipto">
  2.       <FIELD name="name" type="boolean" >
  3.       </FIELD>
  4.       <FIELD name="ID" type="string">
  5.       </FIELD>
  6.       <Association Cardinality="many_to_many" associated_to="shipo"/>
  7.  
  8.   </ENTITY>
  9.  
  10.   <ENTITY name="item">
  11.       <FIELD name="nom" type="boolean">
  12.       </FIELD>
  13.  
  14.       <Association Cardinality="one_to_one" associated_to="item"/>
  15.   </ENTITY>
  16.  
and have something like that:

<Entity> turns to a class in java and the <FIELD> will be attributes of its ENTITY

thanks in advance.
Jul 13 '11 #3
Dheeraj Joshi
1,123 Expert 1GB
Are you looking something like this?

I also found this article. It may help you.

Kind Regards
Dheeraj Joshi
Jul 15 '11 #4

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

Similar topics

14
by: deko | last post by:
Do I need to use flock() when reading a file into an array? It's possible that the file in question could be open at the time the file('filename') request is made. I realize flock() is required...
19
by: Lionel B | last post by:
Greetings, I need to read (unformatted text) from stdin up to EOF into a char buffer; of course I cannot allocate my buffer until I know how much text is available, and I do not know how much...
4
by: Oliver Knoll | last post by:
According to my ANSI book, tmpfile() creates a file with wb+ mode (that is just writing, right?). How would one reopen it for reading? I got the following (which works): FILE *tmpFile =...
11
by: Matt DeFoor | last post by:
I have some log files that I'm working with that look like this: 1000000000 3456 1234 1000000001 3456 1235 1000020002 3456 1223 1000203044 3456 986 etc. I'm trying to read the file...
2
by: archana | last post by:
Hi all, I am new to asp.net (learning phase). I have to develop application in asp.net to read file from client pc and display statistics of that file to client. So my question is that to...
1
by: Cybelle | last post by:
please anyone can help me to solve this stuff, this is our final ., theres an error and i dont know how to solve it., import java.awt.*; import java.awt.event.*; import java.net.*;...
3
by: miss time | last post by:
Hi all, my java friends ^-^ I have next week quiz in reading file text ,and understand the topic very well. can any one give some question related to this topic .this help me more to...
1
by: artic | last post by:
Hi all.. I am currently doing a project on Card Reading using Java. I need one help, which package is best to read the card in java?
1
Coldfire
by: Coldfire | last post by:
Hi, The strange problem i am having is, the input element of type='file' not reading file names after 20 file elements. It simple returns null on reading the 'name' of file. The code is...
1
by: bjoarn | last post by:
I have an Application C# handling file reading, building index on this file, using dll wrapped with SWIG. The dll is originaly programmed in C++. Dll reports back to the the C# programm throug...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.