Closed sedrik closed 10 years ago
I did some more digging and this seems to be a bugg in the sax parser.
erlsom:simple_form("<donald>duck</donald><uncle>scrooge</uncle>").
Event: startDocument
State: {sState,[],#Fun<erlsom_simple_form.0.72756581>,undefined}
Event: {startElement,[],"donald",[],[]}
State: {sState,[],#Fun<erlsom_simple_form.0.72756581>,undefined}
Event: {characters,"duck"}
State: {sState,[{"donald",[],[]}],
#Fun<erlsom_simple_form.0.72756581>,undefined}
Event: {endElement,[],"donald",[]}
State: {sState,[{"donald",[],["duck"]}],
#Fun<erlsom_simple_form.0.72756581>,undefined}
%% I would expect endDocument here
Event: {startElement,[],"uncle",[],[]}
State: {sState,[{"donald",[],["duck"]}],
#Fun<erlsom_simple_form.0.72756581>,undefined}
Event: {characters,"scrooge"}
State: {sState,[{"uncle",[],[]},{"donald",[],["duck"]}],
#Fun<erlsom_simple_form.0.72756581>,undefined}
Event: {endElement,[],"uncle",[]}
State: {sState,[{"uncle",[],["scrooge"]},{"donald",[],["duck"]}],
#Fun<erlsom_simple_form.0.72756581>,undefined}
Event: endDocument
State: {sState,[{"donald",[],[{"uncle",[],["scrooge"]},"duck"]}],
#Fun<erlsom_simple_form.0.72756581>,undefined}
{ok,{"donald",[],[{"uncle",[],["scrooge"]},"duck"]},[]}
Here I would expect the endDocument event to come when we have reached the end tag of the root element donald.
Solved, see issue 25
There seems to be a bug in erlsom when you have an errornous xml with multiple root tags.
I would have expected