I'm a new member, so I hope this hasn't already been beaten to death.
I'm trying to build a prototype as a proof of concept for a workflow
that requires parsing two XML files. In coding this (C++), it occurred
to me that having to conditionally test an element's name *after* the
parser has already scanned it is redundant. There's no reason I should
have to perform a sequence of string comparisons on strings the parser
has already scanned.
On the other hand, I don't have schemas for these files, so I can't use
a data binding tool like CodeSynthesis.
I thought a worthwhile improvement over existing SAX(2) parsers would be
to simply allow registering element name specific callbacks Instead of
just calling me when any element begins or ends, I want to register a
function for when <document> begins or ends, and another function for
when <page> begins or ends, etc. This would make the code *much*
cleaner, and eliminate multiple passes over the same strings.
I have not come across this yet, though admittedly there are a *lot* of
XML parsers out there, and I haven't seen them all. It seems like a
fairly obvious enhancement to an otherwise simple SAX parser.
Anyone ever heard of a solution like this? Free?
The Tech Curmudgeon - http://www.techcurmudgeon.com
Ideas Great and Dumb - http://www.ideasgreatanddumb.com