Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

High level java DOM access

Posted on 2000-05-04
6
Medium Priority
?
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: 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!

 

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 300 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 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