Sebastian, Here's what I know about the DTD for the lfc. The tags compiler reads WEB-INF/lps/schema/lfc.lzx . This file is generated by js2doc.SchemaBuilder using hints from WEB-INF/lps/schema/lfc-undeclared.lzx for things it doesn't know about.
SchemaBuilder sources are in WEB-INF/lps/server/src/org/openlaszlo/js2doc . This program piggybacks on the js2doc translator (which takes all the lfc javascript sources and generates doc), except the SchemaBuilder reads all the lfc javascript sources and generates the lfc.lzx file. So the schema knows about classes, inheritance, methods, what methods are final, what the args are, etc. What is doesn't know is what kind of nodes can contain other nodes, and that's where lfc-undeclared.lzx comes in -- look for the <containsElements> tags to see about that. I hoped one day to put this 'containership' info into the javadoc - then it could appear in the doc too. lfc-undeclared.lzx takes care of various other things, including interfaces (like 'mixin', 'class', 'interface') that have to explicit presence in the lfc sources. I did this most of this work in about 2009 -- lfc.lzx was hand-maintained at the time. I think there were some more improvements in 2011: the class hierarchy had to be perfect to allow the 'with(this)' optimizations to be viable. - Don On Nov 22, 2011, at 3:59 PM, P T Withington wrote: > On 2011-11-22, at 10:00, [email protected] wrote: > >> Are there any special annotations available in the .lzx sources to mark an >> attribute "required" or "optional" ? >> I don't think so yes? So actually in the past DTDs there have been no >> "required" attributes for classes? > > I believe you can say <attribute name="foo" required="true" /> to require > than a sub-class provide a value for the attribute. > >> Further I think that there would be need for a static import at the >> beginning of the DTD section. >> Those parts of the DTD that are generated from ActionScript Classes will >> hardly be possible to write an automatic tool (or if possible only with a >> lot of glitches). >> >> So there will be a static, manually edited "base.dtd" >> and a dynamic part that is build by using the .lzx files. >> The ANT task would then read the base.dtd, extend it with the .lzx files >> and create a lzx.dtd. > > Don (cc-ed) may be able to provide more insight. There is a very small > static file that acts as a foothold to get the rest of the dtd generator > going. > >> Users in the end can then use the same hook in their projects, just with >> the lzx.dtd as the "base.dtd" and dynamically compiling their DTD into a >> "project.dtd". >> The project.dtd could then potentially be used in IDE's to validate. >> >> Sebastian >> >> 2011/11/22 [email protected] <[email protected]> >> >>> Okay, >>> >>> I started on that task right now, shall I assign this issue to me then? >>> >>> I would implemented it using an usual SAXParser, I would prepare a basic >>> sample before commiting. >>> >>> I have to admit that I need to lookup my SVN account for the openlaszlo >>> repo and the process of commiting anything but I guess I can take care of >>> it to that point where its possible to integrate it into trunk. >>> >>> Sebastian >>> >>> >>> >>> 2011/11/22 P T Withington <[email protected]> >>> >>>> There's a Jira for that: >>>> >>>> http://jira.openlaszlo.org/jira/browse/LPP-7225 >>>> >>>> On 2011-11-21, at 13:49, [email protected] wrote: >>>> >>>>> Hi, >>>>> >>>>> there is currently no public lzx.dtd in the internet (again ;)) >>>>> Are there plans to change that? >>>>> >>>>> Also it still is a problem that there is no ANT or similar task to >>>> generate >>>>> such a DTD based on a custom project where you define your own classes >>>> and >>>>> extend the DTD that way. >>>>> Actually it might be a trivial thing to write a DTD-Generator based on >>>>> tools like http://saxon.sourceforge.net/dtdgen.html that re-creates a >>>> DTD >>>>> based on your custom code. >>>>> >>>>> By using a DTD you have almost some kind of code intelligence in Eclipse >>>>> (and other XML Editors that use DTD validation). >>>>> If you just specify for example the DTD in Eclipse for a XML file you >>>> can >>>>> type the "<" bracket and get all suggestions available similar to the >>>>> "ANT-Editor". >>>>> I guess having this kind of auto-completion and validation would be a >>>> huge >>>>> step for a lot of people to start coding with LZX more effectively and >>>>> intuitive then looking up the API docs in the internet. >>>>> >>>>> I am used to ignore them but I also would like to get rid of all those >>>>> warnings in Eclipse complaining about missing DTD sections in the lzx >>>> files >>>>> Maybe I will find some time to contribute such a DTD generator :) >>>>> Such a generator tool could even show you errors in your code... >>>> actually >>>>> having a DTD generator is like having 50% of a potential OpenLaszloIDE. >>>>> >>>>> Was there such a DTD generator script already existing in current >>>>> OpenLaszlo's SVN? >>>>> >>>>> Sebastian >>>>> >>>>> -- >>>>> Sebastian Wagner >>>>> http://www.openmeetings.de >>>>> http://www.webbase-design.de >>>>> http://www.wagner-sebastian.com >>>>> [email protected] >>>> >>>> >>> >>> >>> -- >>> Sebastian Wagner >>> http://www.openmeetings.de >>> http://www.webbase-design.de >>> http://www.wagner-sebastian.com >>> [email protected] >>> >> >> >> >> -- >> Sebastian Wagner >> http://www.openmeetings.de >> http://www.webbase-design.de >> http://www.wagner-sebastian.com >> [email protected] > -- Don Anderson Java/C/C++, Berkeley DB, systems consultant voice: 617-306-2057 email: [email protected] www: http://www.ddanderson.com blog: http://libdb.wordpress.com
