Check out Xalan and Xerces! Found at http://www.apache.org
Main Topics
Browse All TopicsHi,
this is the problem ----
i have a huge XML file, like
<?xml version="1.0" ?>
<root>
<uniqueRoleList>
<uniqueRole>Role 1</uniqueRole>
<uniqueRole>Role 2</uniqueRole>
</uniqueRoleList>
<Person name="andrew singh">
<FullName>Andrew Kustarnikov</FullName>
<Assignments>
<Role>Role 1</Role>
<Group>Group 1</Group>
<GroupRole>Manger</GroupRo
</Assignments>
</Person>
<Person name="Babu">
<FullName>Babu James</FullName>
<Assignments>
<Role>Role 1</Role>
<Group>Group 2</Group>
<GroupRole>System Manger</GroupRole>
</Assignments>
</Person>
.
.
.
.
.
.
</root>
Where in i have first roles and then list of all users.., at many point of time in the application i have to show the list of all users. The number of persons(registered) are expected to be around 4000-5000, i am not sure how to manage this data. I will have to cache it but what am not sure what is the best way to do it.
In a nutshell these are the issues i need a solution for
1. Best way cache such xmls which rarely changes
2. Best way to parse this type of xml
3. How to query such xml data objects
Please advise.
thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Check out Xalan and Xerces! Found at http://www.apache.org
Xerces is a better choice than Xalan, as Apache will be abondoning Xalan, but continuing with Xerces.
If the file is large, I would use SAX and write the data to a database. Access the database for future queries. If you cach the XML as DOM Document, you will use a lot of memory that you don't have to.
DOM is better than SAX if you need to modify the XML, but SAX id more efficient and doesn't load the whole file into memory.
i am already using xerces and storing it in a dom object, but infact to want to use my own class that store the data for me, so that it is light on memory. Now from this class i query and get the result. But i am confused in the initial parsing..should i do it in sax or dom(then delte teh dom object)
If you are storing all the data in a large XML file it will not be light on memory. All you will save is the overhead of the tags, but since the JVM shared strings, you will only be saving one string per XML nodename.
If memory is an issue, you really should persist the data.
Your best bet sounds like is to use SAX as it reads your file line by line. You can then place the data wherever you choose.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- split points between umargul and m_onkey_boy
Please leave any comments here within the
next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
girionis
Cleanup Volunteer
Business Accounts
Answer for Membership
by: umargulPosted on 2002-02-06 at 07:02:33ID: 6782657
For that u have to use a xml parser and some Api's will be lot helpful. U will find JAXP in java.sun.com/xml. And also SAX will be helpful. Visit the link html
www.megginson.com/SAX/sax.