Actually rather than.
>
> interface SimpleTypeResource extends Resource {
>     const STRING_TYPE = 1;
>     const INTEGER_TYPE = 2;
>     const FLOAT_TYPE = 3;
>     const DATE_TYPE = 4;
>     int getType();
>     String getString();
>     void setString();
>     Integer getInteger() throws cast...
>     Date getDate();
>     ...
> }
>
> This interface would roughly encapsulate the XML Scheme predefined simple
> types.

It would be better to do:

QName getType();

which would return {http://www.w3.org/2001/XMLSchema, "string"} i.e. the
actual XML Schema datatype name. Thinking on this, this method might be
properly promoted to the Resource interface itself, as XML Resources might
be referred to by the QName "xsd:complexType" or an actual type if the
implementation were schema aware.

The reason this is important is that XPath 2.0 and XQuery are going to be
the two most important services for XML:DB, and both are type aware.

Of course an implementation might simply return "xsd:complexType" for ALL
XML data and "xsd:string" for ALL simple data (e.g. strings, dates, numbers)
so the implementation overhead for adding this propery could be truly
negligable.

Jonathan

interface QName {
    String getNamespace();
    String getLocalName();
}


----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact administrator:  mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to