xml - Getting "The content of element 'MethodOfPayment' is not complete", even though the element exists -


i having problem validating xml payload against schema. schema section causing issue summarised below. element causing problem "methodofpayment/cheque", according schema documentation needs exist , should not contain content.

<xsd:element name="methodofpayment" minoccurs="0">   <xsd:complextype>     <xsd:choice>       <xsd:element name="cheque">         <xsd:complextype/>       </xsd:element>       <xsd:element name="account">         <xsd:complextype>           <xsd:choice>             <xsd:element name="...">             </xsd:element>             <xsd:element name="...">             </xsd:element>             <xsd:element name="...">             </xsd:element>           </xsd:choice>         </xsd:complextype>       </xsd:element>       <xsd:element name="other">         <xsd:complextype>           <xsd:sequence>             <xsd:element name="...">             </xsd:element>           </xsd:sequence>         </xsd:complextype>       </xsd:element>     </xsd:choice>   </xsd:complextype> </xsd:element> 

i passing in following simple structure:

<methodofpayment>   <cheque /> </methodofpayment> 

but receiving following validation error:

<errormessage>     <![cdata[ invalid request!!! xml document failed validation.please check xml request valid data       cvc-complex-type.2.4.b: content of element 'methodofpayment' not complete.      1 of '{"fake_namespace":cheque,      "fake_namespace":account,      "fake_namespace":other}' expected.]]> </errormessage> 

i have confirmed "account" , "other" sections work fine, "cheque" element. great

i discovered above xml not validating because "cheque" element collapsed. whenever rehydrate element, i.e. <cheque></cheque> opposed <cheque /> validation successful.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -