[Xml-compile] Elements with maxOccurs="100"

Mark Overmeer mark at overmeer.net
Mon Nov 24 12:20:54 GMT 2008


* Zbigniew Lukasiak (zzbbyy at gmail.com) [081124 12:07]:
> On Mon, Nov 24, 2008 at 12:41 PM, Mark Overmeer <mark at overmeer.net> wrote:
> >> <element name="sms-send-result" type="ns:sms-send-result"
> >> minOccurs="0" maxOccurs="100" nillable="true"/>
> >>
> >> But then I get:
> >>
> >> error: complex `x0:sms-send-result-list' requires data at
> >> {urn:calculator}sms-send-output/sms-send-result-list
> >
> > Why does it complain about ...-list, where I do not see you define or
> > use that type?
> 
> This was my mistake in copy-pasting.  I've tried many versions - but
> this is not relevant.

It is relevant for me to understand your question.  There is something
fishy, but it does not fix your problem.  It still looks like a syntax
error in your test, sorry.

> > Another suspectable thing is that you use "nillable"... which means that
> > "undef"s will get encoded into xsi:nil attributes.  You really need that?
> 
> Thanks - this was the problem!  I changed nillable to 'false' and now
> it works.  I think that with nillable="true" it expected a 100
> elements array - maybe it is a good idea for a more explicite error
> message.

I tried this:

 in the schema:
  <element name="test3">
   <complexType>
    <sequence>
       <element name="e3" type="int" minOccurs="0" maxOccurs="12"
           nillable="true" />
    </sequence>
   </complexType>
  </element>

 in Perl:
   { e3 => [ 'NIL', 42, 'NIL', 43, 'NIL' ]}

 in XML:
 <test3 xmlns:xsi="$xsi">
   <e3 xsi:nil="true"/>
   <e3>42</e3>
   <e3 xsi:nil="true"/>
   <e3>43</e3>
   <e3 xsi:nil="true"/>
 </test3>

The writer produced the wrong output.  This will be fixed in 0.97, to
be released later today.  But it is not the error you get.
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list