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



On lun, 24 jui 2000, you wrote:
> Hi Vivien,
> 
> you wrote:
> > ...
> > 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?
> >...
> 
> Of course, there may be situations, where a valid XML doc results in an invalid SQL statement, but I think when we decide to use validation, then we should use it as far as possible. This means, that the valid structure should not depend on attribute values, but only on child elements, that can be validated by the parser and we should use attributes only for parameters as for example table names, field names, ...
> This implies, that the query element should be changed to 
> 
> <!ELEMENT query (select|insert|update|delete|create|drop)>
> <!ATTLIST query
>           id NMTOKEN #IMPLIED>
> 
> and these new elements have to be defined.

Yes, that would mainly solve the problem we talked about, and it will be easier
to know what can and cannot appear and where. That is the right way to proceed.

> 
> 
> > ..
> > I'm always open for new ideas, so please tell me :)
> > ..
> 
> Here is my new proposal for complex type definitions:
> 
> <!ENTITY  % datatype "struct|array|type">
> 
> <!ELEMENT struct (element+)>
> 
> <!ELEMENT element (%datatype;)>
> <!ATTLIST element 
>           name NMTOKEN #REQUIRED>
> 
> <!ELEMENT array (%datatype;)>
> <!ATTLIST array
>           size NMTOKENS #REQUIRED>
> 
> <!ELEMENT type EMPTY>
> <!ATTLIST type 
>           name NMTOKEN  #REQUIRED
>           size NMTOKENS #REQUIRED>
> 

Ok, it looks better than what I proposed, so let's go with it, but let's
replace 
<!ATTLIST type 
           name NMTOKEN  #REQUIRED
           size NMTOKENS #REQUIRED>
by
<!ATTLIST type 
           name NMTOKEN  #REQUIRED
           size NMTOKENS #IMPLIED>
because not all data types need to give a size (like 'cidr' under postgres for
IP adresses)

> This scheme allows the construction of at least the same data types as the C langage. 
> 
> 
> As the C-structs are extended to classes in C++ we could also extend this scheme to support OO.
> 

What do you have in mind?

> 
> 
> You didn't say anything to the new  generic element 'property'  that can be used to define things as for example sequences, so I repeat it here:
> 
> <!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>

Ok, I forgot about it! I agree on this one, but we still have to define what
information the client will get from objects like sequences, etc (in the SCHEMA
stuff)


What would be nice is to make a new version of the DTD from all we have
discussed so far. As I leave my current work here in Paris at the end of the
week, I'm quite busy. I'll probably be also busy next week when I start my new
job in Toulouse, so if you don't want to do it, I'll do it after next week.

Regards,

Vivien




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