I'm struggling with a way to return a hashmap of parsed XML to a main program.
The issue may not be SAXParser problem specifically, but it is related. A pointer or two would be welcome.
I am receiving an XML payload in a POST variable. To parse that variable I call the function passing it the XML payload and expecting back a HashMap. If I inspect the hashmap on return it is blank. The only way to return a value is to make the temporary hashmap in the function a static variable inside the class. That has potentially bad side effects I believe.
In some
test I've found that xmlPayload behaves correctly until the parser finishes (endDocument). At that point, it appears that a new (and empty) xmlPayload is created (unless I use the static keyword). If I use the static keyword though, the returned hashmap contains information from the previous XML (bad!).
I've tried this with two different SAX parsers and so I believe I'm running into a problem with more than SAX. Any suggestions on how to accomplish my goal are more than welcome.
-- Dan