I've created a basic lzx.dtd

http://code.google.com/p/openmeetings/source/browse/trunk/singlewebapp/test/lzx.dtd

A lot of things might still need to be done to that file.

Autogenerating the DTD seems to be not working at all, the files that
generate DTDs that are from Oliver Steele, from 2004/2005. Since that time
nobody seemed to touch them. I don't know if it ever has been working. Is
currently the lzx.rng file autogenerated ? Is the lzx.dtd auto generate ? I
can hardly believe it.

A dtd contains a lot of logical info like:
What child nodes are allowed for a specific node, for example a <view> can
have _ANY_ subnode, while a <text> cannot.
This info is actually not present in the base classes of the lfc. So
generating the dtd automatically does not make so much sense.
Some constructs like: attribute, import, library, include, ... basic
language things => you will not find in source files. So you can't generate
them.

I guess it would be much easier to edit such a "base" DTD manually for now.
Generating this file could take weeks as you will need to modify almost any
source file.
If you going to autogenerate this file then it will be again like in
2004/2005:
For a very limited time the auto-generation works but if you change just a
LITTLE thing nothing works again and as the process is that complex nobody
is going to fix it.

I think a core-developer should be able to modify a DTD file manually if he
extends the core-api.

Sebastian



2011/11/22 P T Withington <[email protected]>

> 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]
>
>


-- 
Sebastian Wagner
http://www.openmeetings.de
http://www.webbase-design.de
http://www.wagner-sebastian.com
[email protected]

Reply via email to