I'm developing a system a part of which parses inputs from an XML file.
I've had a working XML SAX parser supplied by the latest version of the Xerxes Library, but it was scrappy and not particularly flexible.
I need to change the parser because I've changed part of the data structure in my program.
My problem is that because I have some tags in my XML document that have duplicate ID handles the original SAX parser isn't able to distinguish between them.
What I need is a strategy for implementing a SAX parser that "knows" what available actions it can perform in the context of the parent node, even if there are multiple tags with the same ID handle.
I thought about pushing the parent objects onto a stack and selecting the available actions based on a
test using the 'instanceof' and then when the objects close setting them in their correct context but, between my loose understanding of the parsers data flow and getting the idea jumbled up in my head, I don't know if that would be an appropriate solution.
Would that be an appropriate solution, or is there a better one available to me? Or am I simply a gibbering moron?
I've considered a DOM parser, but I'm concerned about memory usage as other parts, and eventually threads, of the program will be hugely memory intensive when they're finally developed.
Cheers,
MLJ