Re: How to disallow empty string elements using XML Schema?

Discussion in 'XML' started by Jan-Erik Öhman, Sep 1, 2003.

  1. Thanks for the hint Bob.

    My previous schema looked like this:

    <xs:element name="Status" type="xs:string"/>

    After your hint I changed it to:

    <xs:element name="Status">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1"/>
    <xs:whiteSpace value="collapse"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>

    Which does exactly what I want.

    /Jan-Erik





    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Jan-Erik Öhman, Sep 1, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,611
    Markus
    Nov 23, 2005
  2. =?ISO-8859-1?Q?Jan-Erik_=D6hman?=

    How to disallow empty string elements using XML Schema?

    =?ISO-8859-1?Q?Jan-Erik_=D6hman?=, Aug 28, 2003, in forum: XML
    Replies:
    0
    Views:
    544
    =?ISO-8859-1?Q?Jan-Erik_=D6hman?=
    Aug 28, 2003
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,296
    Stanimir Stamenkov
    Apr 25, 2005
  4. Lukas
    Replies:
    3
    Views:
    834
    spiff
    Nov 10, 2005
  5. Replies:
    3
    Views:
    2,951
Loading...

Share This Page