SAX or DOM, graph proccesing

  • Thread starter Sebastian.Pawlus
  • Start date
S

Sebastian.Pawlus

SAX or DOM, graph processing.

It is my fist application in XML or I should say it will be.

Problem features.

A xml file wile cover a huge graph structure. In fist sections will be
defined vertex and than next edges. More or less like that. In whole
doc will be one more section, but I think that sections will cover less
than 5% of whole .xml.

I know that SAX works faster than DOM model and works quicker. So SAX
model should be more attractive then DOM as I say before a structure of
graph should be in most of cases huge.
But is something that I didn't tell before that every loaded graph
structure I need to check couple of algorithms like "Connectivity"

So my question is which of model will be more attractive for me.
I should use SAX processing and use call back functions to build my
graph model?. I know that SAX don't require to load whole doc in one
time but I think that is useless for me at the moment.

OR

I should use DOM model and load whole file at one time and after that
try to build structure? But again I know that DOM model eat a lot of
memory.


After the parser will load file, the point is to redraw whole structure
and the next question is.
I should use SAX second time or draw in parallel model?. But if graph
don't pass one of algorithms drawing is for nothing.

OR

I should use DOM model one more time because I have already in memory
whole structure?


Thanks for any replays
X_O
Sorry for any English mistakes taken.
 
?

=?ISO-8859-1?Q?J=FCrgen_Kahrs?=

But is something that I didn't tell before that every loaded graph
structure I need to check couple of algorithms like "Connectivity"

You should have a look at XMLgawk:

http://home.vrweb.de/~juergen.kahrs/gawk/XML/xmlgawk.html

This is a script language that processes XML data
in a SAX-like way. Node-by-node is read and you
can use AWK's associative arrays to check connectivity.
I should use DOM model and load whole file at one time and after that
try to build structure? But again I know that DOM model eat a lot of
memory.

It depends on the expected size of your graphs.
If the XML data is only some mega bytes in size,
then the DOM API may be more convenient. Especially
if you have to traverse the graph more than once.
After the parser will load file, the point is to redraw whole structure
and the next question is.
I should use SAX second time or draw in parallel model?. But if graph
don't pass one of algorithms drawing is for nothing.

Some time ago, I wrote a script that converts the
tree structure of XML data into a drawing. Maybe
this example is useful:

http://home.vrweb.de/~juergen.kahrs/gawk/XML/xmlgawk.html#Converting-XML-data-into-tree-drawings
 
J

Joseph Kesselman

Since it sounds like you're building a custom data model, and one whose
structure is different from the XML document's simple containment tree,
you'll almost certainly want to build it from SAX.
 
S

Sebastian.Pawlus

I've decided the chose one will be SAX at that time. But I'm still
open for new opinions about that thread.

I have one more question about technical side of XML it will be huge
off topic but at least I can try.
What will be more proper do describe my xml language DTD or XMLSchema.
As far I know those two are equal in usage. But what people use. I've
read in book from 2000 that DTD will soon gone and XMLSchema will be on
the TOP. Today we've 2006 and I still see DTD.
 
J

Joseph Kesselman

If you want to be able to use XML namespaces, now or in the future, you
can not use DTDs. Period.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top