OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

asap message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [asap] Discussion on state datatype


Does this look right, xsd fans?

<xsd:simpleType name="stateType">
<xsd:restriction base="xsd:string">
<xsd:pattern value="open.notrunning.?\c*"/>
<xsd:pattern value="open.notrunning.suspended.?\c*"/>
<xsd:pattern value="open.running.?\c*"/>
<xsd:pattern value="closed.completed.?\c*"/>
<xsd:pattern value="closed.abnormalCompleted.?\c*"/>
<xsd:pattern value="closed.abnormalCompleted.terminated.?\c*"/>
<xsd:pattern value="closed.abnormalCompleted.aborted.?\c*"/>
</xsd:restriction>
</xsd:simpleType>


On Mar 1, 2004, at 6:19 PM, John Fuller wrote:

As XML schema goes, it looks like one way to do it might be to provide
a big disjunctive regular expression 'pattern' for restriction.

http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#rf-pattern

Admittedly this looks pretty unseemly compared to other the content
description and validation techniques suggested.


On Feb 28, 2004, at 11:07 PM, Keith Swenson wrote:

We have a datatype definition for "State" to be:
 
<xsd:simpleType name="stateType">
  <xsd:restriction base="xsd:string">
    <xsd:enumeration value="open.notrunning" />
    <xsd:enumeration value="open.notrunning.suspended" />
    <xsd:enumeration value="open.running" />
    <xsd:enumeration value="closed.completed" />
    <xsd:enumeration value="closed.abnormalCompleted" />
    <xsd:enumeration value="closed.abnormalCompleted.terminated" />
    <xsd:enumeration value="closed.abnormalCompleted.aborted" />
  </xsd:restriction>
</xsd:simpleType>
The purpose behind making states as a sequence of dot separate values is that individual implementation are supposed to be able to make extensions to this set.  For example, a company could make  "open.notrunning.beingBackedUp" or some such state.  This 'adds value' to the state.  A partner of their may be able to understand the nuance of beingBackedUp or might not.  Never the less, anyone will understand the beginning part  "open.notrunning".
 
Can a XML Schema be extended in this way?  How do I write the schema that says: "use those 7 values, and then add to them this new 8th value".   Do I need to define the entire set again, and call it "stateType2".  Can I say that stateType2 is stateType with an added value.
 
If we can not extend the state type in this way, then we may need to stay with state type being a simple string.

 
-Keith

Keith D Swenson, kswenson@us.fujitsu.com
Fujitsu Software Corporation
1250 E. Arques Avenue, Sunnyvale, CA 94085
(408) 746-6276   mobile: (408) 859-1005

 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]