RE: Union of Mixed Type

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

Hi,

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

instead of:

<Age></Age>

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"/>
        </xsd:restriction>
    </xsd:simpleType>       

Any suggestion to overcome it instead of:


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

Thanks!!

-------------------------------------------------------------------
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
privileged
or confidential information. If you have received it in error, please
notify
the sender immediately and delete the original. Any other use of this
e-mail
is prohibited.

Received on Wednesday, 22 August 2001 11:13:27 UTC