Documentation : XML

Kurt Wall kwall
Sat Nov 6 01:19:49 PST 2004


On Fri, Nov 05, 2004 at 08:25:12AM +0100, Roger Oberholtzer took 56 lines to write:
> 
> Our current question is to if we should implement DOM (some XML library
> parses a whole XML file in and then your program picks out interesting
> bits) or SAX (the XML parser calls your program as it moves through the
> file). Our files are small (the ones up for becoming XML at this time)
> so we are tending to DOM. Any opinions?

I would make the decision based on how you need to access the tree. If
you're going to jump around the tree, use DOM. If you can process
everything in a stream without needing to backtrack, use SAX.

> parse each others files - but not necessarily understand what was
> parsed. Maybe one calls a paragraph a 'para' and other calls it a
> 'paragraph'. There is no common DTD (which can be used to control how
> the XML file is set up - what are things called and what properties do
> they have) for documents. There are starting to be DTDs for many things.
> Like component description in medicine. But a commonly agreed DTD for
> desktop documenting is not to be found. So, DocBook's XML is still,
> well, DocBook's XML. I wonder if OO will ever support DocBook's DTD.

The lack of a "common" XML DTD is deliberate. It lets you design your own
DTD. I suppose you could always use a schema, but it seems simpler (by
comparison) just to design a DTD that fits your needs.

Kurt
-- 
Pecor's Health-Food Principle:
	Never eat rutabaga on any day of the week that has a "y" in
it.


More information about the Linux-users mailing list