Solved

High level java DOM access

Posted on 2000-05-04
6
223 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now