Re: YAPP+BNF Working Example?
Martin Klang <[email protected]> Sat, 28 Apr 2007 20:11:55 +0200
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
On 25 Apr 2007, at 18:27, Cefn Hoile wrote: > WORKING EXAMPLE? > > I've been trying to get a basic example of YAPP compiling a source > file which conforms to a BNF spec. Cefn, did you try running the examples that come in the download zip? There's an XPath grammar written in BNF (incomplete - XPath is quite a big expression language), toghether with the BNF grammar itself. There are some basic usage instructions in the readme.txt file. You can run the examples using the Makefile with: make test (just edit the Xalan home directory first) Though for some bizarre reason the left-recursion elimination doesn't work with Xalan 2.7.0 unless you enable XSLTC. The error message is not very helpful at all: java.lang.RuntimeException: java.lang.RuntimeException: XSLT TransformerFactory Error It works fine if you pass the -XSLTC flag to Xalan. I've updated the readme file and made some changes to the Makefile so that it works out of the box with Xalan 2.7.0. If you like you might want to simply download the new version [1], or get the updated files from CVS [2]. > P.S. YAPP also relies on the xalan:ignore function, not just the > nodeset function. I had a go at getting it to work with saxon (the > XSLT2.0 processor which I'm using for other projects). Not sure if > this is feasible/sensible. Reverted back to Xalan as couldn't trace > the xalan:ignore function. The stylesheets produce the attribute xalan:ignore as part of the output to force the transformer to include the xalan namespace declaration. Since the prefix is otherwise only used in an attribute value (to prefix the nodeset function) the namespace declaration is stripped from the output. It's not a xalan extension, only a namespace workaround. If you change the xalan namespace URI to that of Saxon or some other processor, it might work out of the box (unless you also need to change the name of the nodeset function). best of luck, /m [1] http://download.pingdynasty.com/o-xml/archive/ [2] http://cvs.pingdynasty.com/viewcvs/o-xml/transform/yapp/