EXIficient / exificient-grammars

Java Implementation of EXI (grammars part)
http://exificient.github.io/java/
MIT License
4 stars 9 forks source link

Grammars2JSON.main() ignores command line and has hardcoded input file name #13

Open jcflack opened 5 years ago

jcflack commented 5 years ago

The 1.0.4 release of Grammars2JSON has a main method with a hard-coded input file name, rather than honoring command line arguments.

It is unfortunate because now it is referred to from the exificient.js demo web page, and the demo requires access to a generated grammar file.

https://exificient.github.io/javascript/

A grammar can be generated by running Grammars2JSON under jdb and setting a breakpoint at line 672, then storing the desired file name into xsd. But it is a bit of distraction from the demo.

danielpeintner commented 5 years ago

@jcflack thanks for pointing us to this short-coming. I proposed a simple fix (see https://github.com/EXIficient/exificient-grammars/commit/d96477062ebdd4245920e44cc1995259699fc7fb)

FYI, https://exificient.github.io/javascript/ does usually not need to create grammar files on its own for JSON. This process is only needed for any other XML schema...

jcflack commented 5 years ago

FYI, https://exificient.github.io/javascript/ does usually not need to create grammar files on its own for JSON. This process is only needed for any other XML schema...

Thanks!

I was referring only to the live in-browser demo located at that page. Unless I missed something, it comes pre-populated with a 'notebook' XML instance in the editorXML pane, but refuses to process it unless I first upload a notebook.xsd.grs from my local filesystem.

I did not see a way to obtain a copy of notebook.xsd.grs other than by downloading notebook.xsd from github and running Grammars2JSON on it.

That makes the "demo" page really a "demo" only for people who are fairly persistent. :)

danielpeintner commented 5 years ago

I see what you refer to. In the case of XML one needs to generally create the grammars based on a dedicated schema.

Having said that, for the notebook example we could simply link the required grammars what we do now. Please take a look at https://exificient.github.io/javascript/ again

Thanks. Hope this resolves this issue.