jaxb - Why doesn't xjc generate a List property when maxOccurs isn't specified on an element? -



jaxb - Why doesn't xjc generate a List property when maxOccurs isn't specified on an element? -

i have schema contains sequence no occurrence defined following

class="lang-xml prettyprint-override"> <complextype name="cultureinfo"> <sequence> <element name="a" type="string"/> <element name="b" type="string"/> </sequence> </complextype>

after running xjc, jaxb doesn't generate , b list<> meaning 1 instance always. know can prepare problem adding

class="lang-xml prettyprint-override"> <xs:sequence maxoccurs="unbounded">

unfortunately, can't alter schema. wondering , getting conflicting information, default meaning if no maxoccurs specified, can and/or b appear multiple times? site says yes, says no, jaxb says no (that's why no list<>).

when maxoccurs not specified, default 1 in xml schema.

from http://www.w3.org/tr/xmlschema-0/ section 2.2.1 occurrence constraints:

the comment element optional within purchaseordertype because value of minoccurs attribute in declaration 0. in general, element required appear when value of minoccurs 1 or more. maximum number of times element may appear determined value of maxoccurs attribute in declaration. value may positive integer such 41, or term unbounded indicate there no maximum number of occurrences. default value both minoccurs , maxoccurs attributes 1. thus, when element such comment declared without maxoccurs attribute, element may not occur more once. sure if specify value minoccurs attribute, less or equal default value of maxoccurs, i.e. 0 or 1. similarly, if specify value maxoccurs attribute, must greater or equal default value of minoccurs, i.e. 1 or more. if both attributes omitted, element must appear once.

jaxb

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -