Solved

High level java DOM access

Posted on 2000-05-04
6
231 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
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 

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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

729 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