xsd - xmlSchema apache in java -


i'm using library in java xmlschema of apache. create new object xmlschemaelement , set attributes minoccurs, maxoccurs , nillable in way:

xmlschemaelement elem = new xmlschemaelement(); elem.setname("element1"); elem.setnillable(false); elem.setminoccurs(1); elem.setmaxoccurs(1); 

i xsd:

<xs:element name="element1">   ........ </xs:element> 

i not attributes minoccurs, maxoccurs , nillable.

how can fix problem?

i should item xsd this:

<xs:element name="element1" minoccurs="1" maxoccurs="1" nillable="false">   ... </xs:element> 

thank much.

minoccurs , maxoccurs can used when element declaration nested in group, such <xs:sequence>. if creating top-level <xs:element> elements, it's illegal have attributes.

try adding element child group (sequence, choice, all, etc.)


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -