[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Datatypes
Attached is an updated proposal for how TREX should handle datatypes. This proposal allows users to define datatypes. JamesTitle: Datatypes in TREX
datatypeNamespace
like the current ns
attribute, which is allowed on every
element and is inherited.ns
attribute is renamed to
defaultNamespace
.datatypeNamespace
attribute.type
attribute containing a NCName which identifies
a datatype by name as described above.setParams
element. This uses a datatypeSpec to
identify the base datatype and contains a list of one or more
param
elements specifying the parameters.enum
element. This uses a datatypeSpec to identify
the base datatype and contains a list of one or more
value
elements specifying the allowed values.data
element uses a datatypeSpec to specify the
datatype matched by the pattern.data
element can have either a key
or a keyRef
attribute that specifies identity
constraints.string
and normalizedString
. This namespace
URI is the default for the datatypeNamespace
attribute.string
element is removed.anyString
element is renamed to
text
.grammar
element can have any number of
datatype
children in addition to define
and
start
children. The datatype
element
creates a definition in the datatype symbol space of the
grammar
element. The definition binds the NCName
specified by the name
attribute to a datatype specified
by a datatypeSpec.define
element is renamed to
pattern
.oneOrMore
and
zeroOrMore
.Here's a fragment of a TREX pattern for TREX as it would be with this proposal:
<grammar datatypeNamespace="http://www.w3.org/2001/XMLSchema-datatypes"> <pattern name="datatypeSpec"> <choice> <attribute name="type"> <data type="NCName"/> </attribute> <element name="setParams"> <ref name="datatypeSpec"/> <oneOrMore> <element name="param"> <text/> </element> </oneOrMore> </element> <element name="enum"> <ref name="datatypeSpec"/> <oneOrMore> <element name="value"> <text/> </element> </oneOrMore> </element> </choice> </pattern> <-- Allowed as a child of grammar. --> <pattern name="datatype"> <element name="datatype"> <attribute name="name"> <data type="NCName"/> </attribute> <ref name="datatypeSpec"/> </element> </pattern> <-- Allowed as a pattern. --> <pattern name="data"> <element name="data"> <optional> <choice> <attribute name="key"> <data type="NCName"/> </attribute> <attribute name="keyRef"> <data type="NCName"/> </attribute> </choice> </optional> <ref name="datatypeSpec"/> </element> </pattern> </grammar>
Here's how Kawaguchi-san's example might look:
<grammar datatypeNamespace="http://www.w3.org/2001/XMLSchema-datatypes"> <datatype name="localTime"> <setParams type="time"> <param name="pattern">[0-9]+:[0-9]+:[0-9]+</param> </setParams> </datatype> <start> <element name="appointment"> <data> <setParams type="localTime"> <param name="minInclusive">08:00:00</param> <param name="maxInclusive">20:00:00</param> </setParams> </data> </element> </start> </grammar>
key
and keyRef
attributes on
data
, we need a definition of datatype identity. We can
resolve a datatype into a primitive datatype name, a set of parameters
and a set of values. One possibility is to say that two datatypes are
the same if all these three things are the same. Should datatype
parameters be considered as typed for the purposes of determining
identity?setParams
override parameters that the base
datatype specifies?datatype
have a combine
attribute?
If so, what values can it take? At least it should allow
replace
.enum
be called enumeration
instead?ns
be renamed to targetNamespace
instead of defaultNamespace
?setParams
to derive from a datatype
defined by enum
?string
and normalizedString
?$Id: datatypes.html,v 1.4 2001/05/12 07:46:01 jjc Exp $
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC