Re: Antw: Re: revised gda-xml-query.dtd

On ven, 21 jui 2000, you wrote:
> Hi Vivien,
> you wrote:
> > ...
> > This means that the <array> element cannot be defined in the DTD (as for
> > other nonstandard data types), which is not really nice!
> > 
> > There is a difference between arrays and other data types like
> > varchar: arrays need one arg to tell them the data type stored and others for
> > the dimensions, and are written type[?][?][?]... Other data types like varchar
> > need one arg for its size and is written varchar(?). We could imagine other
> > data types which would require more args and would be written dummy(?,?).
> > 
> > I propose the creation of several new elements:
> > <!ELEMENT datatypearg (datatypedef)?>
> > <!ATTLIST datatypearg
> >           order (1|2|3|4|5|6|7|8|9|10) #REQUIRED
> >           value NMTOKEN #IMPLIED>
> > 
> > <!ELEMENT datatypedef (datatypearg)*>
> > <!ATTLIST datatypedef
> >            name NMTOKEN #IMPLIED>
> > 
> > <!ELEMENT fielddef (datatypedef)?>
> > <!ATTLIST fielddef
> >           id   ID      #IMPLIED
> >           name NMTOKEN #REQUIRED
> >           type NMTOKEN #REQUIRED
> >            size CDATA   #IMPLIED
> >            notnull (yes|no) "no">
> > ....
> I'm sorry, but I think this solution has also a drawback. If I understood you right, you criticized by proposal because it's not definded in the DTD and therefore can't be validated. But your solution only allows some kind of pseudo-validation, because you have rules, that nowhere occur in the DTD
> (because of the limited posibilities of a DTD):

Yes, you are right!

> > * if the type name is "array", then the first datatypearg element given MUST be
> > the data type for the array, and the next ones the dimensions of the array.
> DTDs don't care about the values of attributes and therefore a query may be valid with regard to the DTD but invalid with regard to XML-query.
> BTW the same problem occures in other elements as for example  your 'query' or my 'trailer'. In all these cases the valid (with regard to XML-query) structure
> depends an attribute values that can't be valided (with regard to the XML-DTD).
> I see two ways, actually only one ;-) , to go on
> 1.) we ignore these problems (I wouldn't like this!!!) and use your proposal, maybe with some modification that I would suggest

If an XML document is valid (from the DTD) then the provider must try to use
it, but can still return an error if it is not valid (from a query point of
view). I don't think it is a problem. There is the same situation with SQL
specifications, no?

> 2.)  we introduce some elements like 'struct', 'array', 'list' and 'type' (all defined in the DTD) and use these elements to construct complex types, as you do it languages like C. Of course I have prepared a proposal for that :-).
> If we go the second way, we also should revise the other elements and make some changes, for example the two listed above.
> Other construction site:
> To define things like sequences we could use a generic element 'property' in the following way:
> <!ELEMENT sequence (property*)>
> <!ATTLIST sequence 
>                   name NMTOKEN #REQUIRED>
> <!ELEMENT property EMPTY>
> <!ATTLIST property
>                    name NMTOKEN #REQUIRED
>                    value NMTOKEN #REQURED>
> Then you can define a sequence as follows:
> <sequnce name="seq1">
>    <property name="start" value="0"/>
>    <property name="inc" value="1"/>
> </sequence>
> Intently waiting for your answer

I'm always open for new ideas, so please tell me :)



PS: I'a away for the week end so I won't answer till monday...

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]