From: Dan M. <dan...@gm...> - 2011-12-28 18:57:20
|
Hi Casey, I think the only way I know how to do this would be to create a new custom "grammar" file for a custom XQuery parser. You would first need to create a custom "ANTLR <http://www.antlr.org/>" grammar file. You would then declare that this grammar must be used in your XQuery declaration like this: *xquery version "1.0-custom";* Most people can pick up ANTLR after a few years of computer science classes in creating compilers and parsers. But be warned it is not easy. Here is a link to the eXist xquery "grammar" file: http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/src/org/exist/xquery/parser/XQuery.g?revision=15599&view=markup Once this is done you would also need a custom version of eXist compiled with this grammar in place. If you don't have time to learn ANTLR you might post request for help on the ANTLR interest group antlr-interest. - Dan On Wed, Dec 28, 2011 at 12:31 PM, Casey Jordan <cas...@jo...>wrote: > Since eXist has its own XQuery analyzer/compiler, would it be possible to > enforce custom rules. Say a rule to force the developer into declaring > certain variables in particular files? > > For example, we have "instance.xql" files in our application, which need > to take a specific form. In the prolog I would like to force the developer > to define a variable like: > > declare variable $app-name = "somevalue"; > > And, if the compiler did not encounter this, it would throw an error? > > Thanks, > > Casey > > -- > -- > Casey Jordan > easyDITA a product of Jorsek LLC > "CaseyDJordan" on LinkedIn, Twitter & Facebook > (585) 348 7399 > easydita.com > > > This message is intended only for the use of the Addressee(s) and may > contain information that is privileged, confidential, and/or exempt from > disclosure under applicable law. If you are not the intended recipient, > please be advised that any disclosure copying, distribution, or use of > the information contained herein is prohibited. If you have received > this communication in error, please destroy all copies of the message, > whether in electronic or hard copy format, as well as attachments, and > immediately contact the sender by replying to this e-mail or by phone. > Thank you. > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Exist-development mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-development > > -- Dan McCreary Semantic Solutions Architect office: (952) 931-9198 cell: (612) 986-1552 |