Questions tagged [minoccurs]
17 questions
5
votes
1 answer
Do XML parsers tell the difference between xsi:nil="true" and omitted elements?
Are XML parsers/deserializers in general able to tell the difference between nillable elements explicitly set to null and optional elements that are left out?
Assume that we have the following complex type:
…

nize
- 1,012
- 1
- 11
- 27
4
votes
1 answer
Is it possible to override the minOccurs & maxOccurs attribute of an element in complexType by extension?
Is it possible to override the minOccurs & maxOccurs attribute of an element in complexType by extension?
I have a xsd for a application configuration and I want to extend the complextype to make the attributes optional and get only the elements…

Kaja Mohideen
- 41
- 3
3
votes
1 answer
minOccurs/maxOccurs in XML Schema
Given this XML Schema snippet:

Dan Lugg
- 20,192
- 19
- 110
- 174
2
votes
1 answer
Override minoccurs of an element from parent xsd
is it possible to override the minOccurs/maxOccurs attributes of an element in the parent xsd? we can easily extend the parent xsd and create a new xsd with different namespace, but am trying to override with same parent namespace.
Lets say we have…

madRai
- 79
- 1
- 6
1
vote
2 answers
minOccurs/maxOccurs on xsd:sequence vs xsd:element?
Let say we have the following schema (from a Microsoft sample):

Jean-Philippe
- 173
- 10
1
vote
1 answer
In XSD, when optional parent element occurs, are its children mandatory?
I have been wondering about a simple but very important question.
I have a parent element that is optional because of minOccurs="0" but its child elements do not have any minOccurs or maxOccures attributes defined.
Am I right that in case the parent…

Fonolit
- 11
- 2
1
vote
1 answer
XML Schema: keyref with optional field
I wonder if it's possible to use keyref element with optional fields.
e.g. Given the following schema:
…

gentooise
- 416
- 3
- 8
1
vote
1 answer
minOccurs and maxOccurs inside choice
I am trying to restrict elements inside a choice element with minOccurs and maxOccurs, but it doesn't look like it is working.
I created a choice and tried to restrict "person" to 1 occurence max, and "address" to 1 occurence min, but when I try to…

realUser404
- 2,111
- 3
- 20
- 38
1
vote
1 answer
XSD Make minOccurs depend on containing type
I have a complex type defined which doesn't currently contain any minOccurs restrictions. When I use this comlpex type as an element type I sometimes want the elements to have minOccurs 0, other times 1. E.g.
…

ng5000
- 12,330
- 10
- 51
- 64
0
votes
1 answer
How to check XML for missing elements using XSD
The default for minOccurs property of an in an XSD file is 1 (source).
Consider you have an XSD specifying a complex type containing 2 elements: and .
If you provide an XDocument only containing , the XDocument will not…

Peter
- 114
- 3
- 11
0
votes
1 answer
XSD XML minOccurs="0"
I'm trying to allow no Res_0_CD tag/value with ResCD tag and value. Below is the XML:
7
3
…

Robert Meek
- 23
- 4
0
votes
2 answers
How can I combine a restriction with occurence indicators in an XSD file?
Suppose I have the following XSD file :

Yohann
- 1
- 3
0
votes
1 answer
Web service request from SoapUI with a missing int parameter automatically assigns 0 value when minOccurs=1
I have a web service with a single web method:
[WebMethod]
public string SendInt([XmlElement(IsNullable=false)] int someInt)
{
return "Hello World";
}
The WSDL generated by this web method includes the following lines:

Jaqen H'ghar
- 16,186
- 8
- 49
- 52
0
votes
2 answers
about the use of minOccurs & maxOccurs in XML files
I would like to have this behaviour : a complex element has got some elements (so it does not contains a sequence) but some of these elements have got "minoccurs" and/or "maxoccurs" defined.
I tried to build such a file, and it looks like…

lolveley
- 1,659
- 2
- 18
- 34
0
votes
1 answer
XSD: How does one make optional (sub)elements dependable?
Let's assume working with xml documents like this:
-
10
1.5
18
and
-
12
The meaning of the data is: An Item must have a price and optionally ratio…

dk1844
- 265
- 2
- 12