Solved

High level java DOM access

Posted on 2000-05-04
6
227 Views
Last Modified: 2008-03-10
Hi

A heard some rumours about a high level DOM tool for java.
If I have an XML doc like:
<article>
<section>foo</section>
<section>bar</section>
</article>

Does anyone know of tool that can give me java classes to
access the XML data above like:
article.sectionList[2].value == "bar"
or something similar?

/Klas
0
Comment
Question by:eklas
6 Comments
 

Expert Comment

by:anita_c
ID: 2777773
Java got a DOM parser you could downloade from sun's homepage www.java.sun.com

but it's a bit more complicated than that... The parser can give you an tree that is similar to your xml structure. Everything is considered a node or an element and there is a bunch of methods that can be used
0
 

Author Comment

by:eklas
ID: 2778445
I'm not at all looking for an ordinary DOM
parser.
0
 
LVL 8

Expert Comment

by:shlomoy
ID: 2785205
providing the DTD of your XML articles,
I suspect you will be able to find the tool you want.
What id the DTD's name?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:eklas
ID: 2786158
The DTD is home made. Let's call it "foobar.dtd".
0
 

Expert Comment

by:TomWilson
ID: 2786833
IBM have an XML parser at http://www.alphaworks.ibm.com/tech/xml4j
0
 
LVL 1

Accepted Solution

by:
yanchou earned 100 total points
ID: 2786874
There are no standard tool for your purpose, however, we developed a similiar API  for this purpose. The whole idea is to parse the XML using SAX and put the result in hash table like following

<article title='whatever'>
<section>foo</section>
<section>bar</section>
</article>


article[1].title.att == whatever
article.sectionList[1].value == "foo"
article.sectionList[2].value == "bar"


We can also translate the hash table back into XML





0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question