Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: equivalent of "NOT NULL" in schema?

From: "Pete Cordell" <petexmldev@--------------.--->
To: <xmlschema-dev@--.--->, "Lev Lvovsky" <lists2@------.--->
Date: 3/13/2007 5:00:00 PM
I'm assuming that your using the NOT NULL in the SQL sense.  This maps to 
schema's nillable feature.  In schema's case NOT NULL is the default.

I think xs:string (as a few variations of that) are the only types that you 
have to worry about having zero length.  Therefore, it sounds like you need 
to define a type of string that has minimum length one.  You may also need 
to define a pattern for it so that strings such as single spaces are not 
allowed.  For example:

    <xs:simpleType name="stringMin1">
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>

Or:

    <xs:simpleType name="stringMin1">
        <xs:restriction base="xs:string">
            <xs:pattern value=".*\S.*"/>
        </xs:restriction>
    </xs:simpleType>

HTH,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx/
http://www.codalogic.com/lmx/
=============================================

----- Original Message ----- 
From: "Lev Lvovsky" <lists2@s...>
To: <xmlschema-dev@w...>
Sent: Monday, March 12, 2007 7:16 PM
Subject: equivalent of "NOT NULL" in schema?


>
> Hello, I'm new to Schema, so if this question is not appropriate for  this 
> list, please let me know.
>
> We're using SOAP to transfer data from one database to another.  I'm  in 
> the process of working out a Schema definition which allows us to 
> validated the SOAP response as much as possible before attempting  inserts 
> into the database.  I'm curious what the best way to define a  type which 
> implies "NOT NULL", specifically, that an element must  have at least one 
> character present for whatever data type it is.   Clearly this can be done 
> with multiple restrictions on minLength of a  simpleType, but is there any 
> way to "inherit" from a "not null" type  in the Schema to where a string 
> or integer simply uses that "not  null" type  as a base?  The goal being 
> to use the "minLength"  qualifier only once.
>
> Any help would be appreciated!
>
> thanks,
> -lev
>
> 



From mamidogad@g... Wed Mar 14 20:47:46 2007
Received: from wiggum.w3.org ([128.30.52.23])
	by frink


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent