Sjoerd Visscher announced a tiny parser for MinXML written in 28 lines of JavaScript.
The parser demonstration uses what doesn't look like a well-formed XML or MinXML document (too many root elements),
but this behavior is reflected in the underlying code, which treats the stream as multiple documents within a single file. As the
MinXML spec says in Section 3.1, "Minimal XML parsers must be able to parse multiple
documents in a single stream or file."
This very simple bit of code appears to smoothly parse the test document and modifications as well, and may prove an easy
way to integrate MinXML with browser-based applications.
Update: Visscher has updated this parser and renamed it JaSMin. The script is now 50 lines of code
rather than 28.
|