FrancisBourre / lowra

Automatically exported from code.google.com/p/lowra

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DTD for ioc xml files is not in sync with documentation

GoogleCodeExporter opened this issue · comments

The dtd at http://lowra.googlecode.com/svn/trunk/tools/assembler.dtd is not
fully in sync with documentation.

Some examples:
- <rsc> does not recognize the deserializer-class attribute.
To fix this one, just replace :
<!ATTLIST rsc url CDATA #REQUIRED
              id CDATA #REQUIRED
              type  (binary|text) #IMPLIED>

with
<!ATTLIST rsc url CDATA #REQUIRED
              id CDATA #REQUIRED
              type  (binary|text) #IMPLIED
              deserializer-class CDATA #IMPLIED>

- <beans> does not allow for the <%custom%> tag. Unfortunately this can't
be fixed nicely in dtd. The only alternative would be to declare beans's
childs to #PCDATA, which would remove all limitations on number of
occurrences of application-loader, dll, include, root. Alternatives for
this one would be to either change the XML structure (for instance having
all <%custom%> tags within another tag, which would be an optional direct
son of beans, or change the DTD with a XML Schema, which can easily fix
this using <xs:any minOccurs="0"/>

I offer myself to write the XML Schema if you consider it appropiate.

Original issue reported on code.google.com by juansot...@gmail.com on 14 Nov 2009 at 2:27

I here submit a XML Schema that is in sync with documentation.

It will however not test for <%custom%> tags internal syntax (due to the very 
nature
of the <any> tag in XML Schema), but will prevent them from appearing in invalid
places, and providing the appropiate ocurrance limitations for all tags. 
Therefore,
on it's own it's an improvement from the original DTD.

Notice however, that the Schema supplied does define a "beanType" complex type, 
that
follows syntax restrictions of %custom% tags, and there are a couple comments
indicating how to enable it to replace <any>. It will break backwards 
compatibility,
since <%custom%> tags won't be allowed anymore, but a given name must be used 
("bean"
is suggested). However, I don't see this as an issue, since the usage of 
<%custom%>
forbids any future expansion without breaking backwards compatibility on it's 
own.

Original comment by juansot...@gmail.com on 23 Nov 2009 at 6:25

Attachments: