Next in thread → Next in month →

Re: [xml-dev] XML Schema: nillable vs. minOccurs

From
John Cowan <>
To
Brian Speight <>
Date
2003-09-23T17:32:53Z
ID
<>
Thread
Re: [xml-dev] XML Schema: nillable vs. minOccurs
Brian Speight scripsit:

> I'm looking for advice on usage of nillable vs. minOccurs. When you
> have an element that is optional should you use "nillable=true" or
> "minOccurs=0" or both? Using both seems to make things more complicated
> than necessary.

They mean two different things.  For a truly optional element, one that is
allowed to be absent altogether, minoccurs="0" is what you want.  Nillable
means that the element can be present without its normal content, provided
that xsi:nil="true" is one of its attributes.

-- 
Do NOT stray from the path!             John Cowan <>
        --Gandalf                       http://www.ccil.org/~cowan
Next in thread → Next in month →