Solved

High level java DOM access

Posted on 2000-05-04
6
230 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Test ddwrt:UserLookup 1 71
XML & .net 5 52
ebay devID, appID, certID, userToken 2 85
Please Explain What Reading a Zip file Back In Means 11 68
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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 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