CodeSOD: A Stack of XML Note

CodeSOD: A Stack of XML

Alice uses an XML-based RPC system with a hand-rolled parser that expects specific data formats.The data format includes verbose XML tags with params, structs, members, and values enclosed by types.Recently, the API changed to include empty data tags, causing the parser to malfunction.The parser tracks a stack to keep track of parsing progress, but it only pushes onto the stack for data or value elements.When data tags were added, the parser stopped working due to a mismatch in pushing and popping the stack.Specifically, when encountering a data element, the parser pushes the stack but never pops it.This desynchronizes the tree and breaks parsing.Since the issue was discovered, most service calls have switched to JSON.However, some calls still use XML, constraining the API's ability to add data fields.The XML endpoints are expected to be phased out eventually.