Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the xsd minOccurs default value?

Status
Not open for further replies.

ttdobj

Technical User
Sep 30, 2002
63
GB
If in an XSD, an element does not have minOccurs specified, what default value is that element assumed to have?

I am running Stylus Studio, which seems to think that the it therefore defaults to a minOccurs value of 1.

Is this right?

Ta

John
 
But also, if an element is present in the file but is empty. For example:
Code:
<foobar />

is that the equivalent of an occurance of once or no occurance?

Yours confusedly

John
 
[1] If I take a quick tour to w3.org schema spec., there is this.
[tt]quote
XML Representation Summary: element Element Information Item

<element
abstract = boolean : false
block = (#all | List of (extension | restriction | substitution))
default = string
final = (#all | List of (extension | restriction))
fixed = string
form = (qualified | unqualified)
id = ID
maxOccurs = (nonNegativeInteger | unbounded) : [blue]1[/blue]
minOccurs = nonNegativeInteger : [blue]1[/blue]
name = NCName
nillable = boolean : false
ref = QName
substitutionGroup = QName
type = QName
{any attributes with non-schema namespace . . .}>
Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
</element>
[/tt]
The two "1" are meant for default value.

[2]
><foobar />
>is that the equivalent of an occurance of once or no occurance?

It counts as once.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top