LMNOP

LMNOP is a Java parser for LMNL syntax and XML syntax, which generates a series of SAL events.

This is currently alpha software; any bugs should be reported to Jeni Tennison.

Implementation

SAL (Simple API for LMNL)
sal.jar
SAL probably isn't really ready for prime-time yet, but let's experiment and see where the gaps are.
SAL is a complete rip-off of SAX.
LOM (LMNL Object Model)
lom.jar
LOM is still under review as well.
You only need this because the LMNLSerializer now uses it.
LMNOP
lmnop.jar
LMNOP incorporates a LMNLParser (a rip-off of Aelfred), an XMLParser that simply uses a SAX-to-SAL filter, and a LMNLParserTest for testing it out.

To run LMNOP, make sure that your classpath contains lmnop.jar, sal.jar and lom.jar. For XML parsing and serialisation, LMNOP depends on the packages:

These packages are available as part of Xerces.

If you want to test the parser on your documents, you need to use the command line:

java com.jenitennison.lmnop.LMNLParserTest input-document [-xml]

The input-document can be any document. If the file has the extension .xml it will be interpreted as a document in XML syntax; if it has any other extension, it will be interpreted as a document in LMNL syntax.

The document should basically get echoed back to you, but with a LMNL declaration, with entities replaced, and with the locations of namespace and layer declarations most probably changed, so that they appear just before they're needed. Or, if there's something amiss in your LMNL document, you should get an error or warning. If you use an XML document as the input, you may want to get an XML document as the output, in which case use the -xml flag and LMNOP will generate XML rather than LMNL.

Source

Go easy; I'm not really a Java programmer.

SAL Java source code
salsrc.zip
LMNOP Java source code
lmnopsrc.zip