W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2001

RE: Union of Mixed Type

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Wed, 22 Aug 2001 08:12:50 -0700
Message-ID: <E5B814702B65CB4DA51644580E4853FB8D4F10@red-msg-12.redmond.corp.microsoft.com>
To: "Zhanshou Yu" <zyu@prosrm.com>, <xmlschema-dev@w3.org>
Create a restriction (or enumeration) of string that allows 
only the single space.  Create a union type of this restricted string
and integer.

All the best, Ashok 
Ashok Malhotra              <mailto: ashokma@microsoft.com> 
Microsoft Corporation

-----Original Message-----
From: Zhanshou Yu [mailto:zyu@prosrm.com] 
Sent: Thursday, July 19, 2001 12:06 PM
To: 'xmlschema-dev@w3.org'
Subject: Union of Mixed Type


We have a client who requires that if the value of an element is null,
put a space('  ') instead. For example:

instead of:


They'd like to show as

<Age>   </Age>

I'd like to define this element as : "xsd:int" but the stupid space will
kill me.

I know the following is illegal:

    <xsd:simpleType name="intergerOrSpace">
        <xsd:restriction base="xsd:string"> ??????
            <xsd:enumeration value=" "/>
            <xsd:enumeration value="xsd:int"/>

Any suggestion to overcome it instead of:

    <xsd:simpleType  name = "intergerOrSpace">
      <xsd:restriction base="xsd:string">
          <xsd:pattern value="(    )|([0-9]*)"/>  


Zhanshou Yu
PROS Revenue Management
Email:  zyu@prosrm.com
Tel.   :  713-335-8040

This e-mail is for the designated recipient only and may contain
or confidential information. If you have received it in error, please
the sender immediately and delete the original. Any other use of this
is prohibited.
Received on Wednesday, 22 August 2001 11:13:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC