• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

High level java DOM access

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
eklas
Asked:
eklas
1 Solution
 
anita_cCommented:
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
 
eklasAuthor Commented:
I'm not at all looking for an ordinary DOM
parser.
0
 
shlomoyCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
eklasAuthor Commented:
The DTD is home made. Let's call it "foobar.dtd".
0
 
TomWilsonCommented:
IBM have an XML parser at http://www.alphaworks.ibm.com/tech/xml4j
0
 
yanchouCommented:
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

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now