You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Stefan Lischke <s....@zertificon.com> on 2008/03/10 13:42:02 UTC

found bug minOccures=0 ignored for xs:any

hi,

XMLBeans seems to ignore the minOccurs="0" attribute on xs:any, it
always expects an element.... very strange:


i have the following schema:
...
<xs:element name="CAdata" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:any namespace="##other"
processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                    <xs:attribute name="CAname" type="xs:string"
use="required"/>
                    <xs:attribute name="value" type="xs:string"
use="optional"/>
                 </xs:complexType>
            </xs:element>
...

and the following instance:

junit.framework.AssertionFailedError: EntityManagerException 'XML Format
of KeyCertPair is not valid.
error: cvc-complex-type.2.4d: Expected element(s) in element
CAdata@http://www.zertificon.com/erpconnector/v1/entity_management

<X>
...
  <CAdata value="ich bin die id" CAname="testCA"/>
...
</X>

And .validate() fails with

'XML Format of KeyCertPair is not valid.
error: cvc-complex-type.2.4d: Expected element(s) in element
CAdata@http://www........




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: found bug minOccures=0 ignored for xs:any

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
The Schema information used for validation is indeed in the .xsb file.
If you want to look into the issue further, look under the bin/
directory in the distribution and you will see a dumpxsb script. Do

dumpxsb type.xsb

to get the content of the xsb file in a human-readable form (and look at
the implementation if you want to understand more about the binary
format itself).

Hope this helps,
Radu

On Thu, 2008-03-13 at 12:23 +0100, Stefan Lischke wrote:
> I filed this bug to Axis2 [1]
> 
> But i want to investigate further, where do i find the schema
> information that is used for validation? is it inside the generated
> classes or inside the xsb files?
> 
> i noticed that there is a small difference in the cadataf932elemtype.xsb
> file
> 
> 
> ---plain xmlbeans version---
> binary
> 
> _BI_string
> -------------------------------------
> 
> ---axis2&xmlbeans version---
> binary
> _BI_string
> -------------------------------------
> 
> 
> 
> [1] http://issues.apache.org/jira/browse/AXIS2-3599
> Radu Preotiuc-Pietro wrote:
> > In this case, I am afraid I am not very familiar with how Axis2 packages
> > XmlBeans, but it does sound surprising that they would change the result
> > of compilation in this way. You are going to have to bring this up on
> > Axis' mailing list.
> >
> > Radu
> >
> > On Wed, 2008-03-12 at 19:18 +0100, Stefan Lischke wrote:
> >   
> >> Hi,
> >>
> >> I found out, that it works great if i compile the beans with XMLBeans
> >> 2.3.0 only. But when i use Axis2 with XMLBeans the validation fails.
> >> I even tried the xmlbeans version that is deliverd with Axis2 with the
> >> xmlbeans generated classes and it validates fine. It must be something
> >> at the bean generation in combination with Axis2.
> >> I took a look at the resolver but could not find anything.
> >>
> >> I debugged validation process and found that the the SchemaParticleImpl
> >> has minoccurs set to 1 when using the axis2+xmlbeans generated  beans.
> >>
> >> Very strange,
> >>
> >> any idea?
> >>  
> >> Radu Preotiuc-Pietro wrote:
> >>     
> >>> This one too works for me. Only if I change "minOccurs" on the <any> to
> >>> "1", I get the error that you are getting. Use the "validate" script
> >>> (under bin/) to easily check this.
> >>>
> >>> Radu
> >>>
> >>> On Mon, 2008-03-10 at 13:42 +0100, Stefan Lischke wrote:
> >>>   
> >>>       
> >>>> hi,
> >>>>
> >>>> XMLBeans seems to ignore the minOccurs="0" attribute on xs:any, it
> >>>> always expects an element.... very strange:
> >>>>
> >>>>
> >>>> i have the following schema:
> >>>> ...
> >>>> <xs:element name="CAdata" minOccurs="0" maxOccurs="1">
> >>>>                 <xs:complexType>
> >>>>                     <xs:sequence>
> >>>>                         <xs:any namespace="##other"
> >>>> processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
> >>>>                     </xs:sequence>
> >>>>                     <xs:attribute name="CAname" type="xs:string"
> >>>> use="required"/>
> >>>>                     <xs:attribute name="value" type="xs:string"
> >>>> use="optional"/>
> >>>>                  </xs:complexType>
> >>>>             </xs:element>
> >>>> ...
> >>>>
> >>>> and the following instance:
> >>>>
> >>>> junit.framework.AssertionFailedError: EntityManagerException 'XML Format
> >>>> of KeyCertPair is not valid.
> >>>> error: cvc-complex-type.2.4d: Expected element(s) in element
> >>>> CAdata@http://www.zertificon.com/erpconnector/v1/entity_management
> >>>>
> >>>> <X>
> >>>> ...
> >>>>   <CAdata value="ich bin die id" CAname="testCA"/>
> >>>> ...
> >>>> </X>
> >>>>
> >>>> And .validate() fails with
> >>>>
> >>>> 'XML Format of KeyCertPair is not valid.
> >>>> error: cvc-complex-type.2.4d: Expected element(s) in element
> >>>> CAdata@http://www........
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> >>>> For additional commands, e-mail: user-help@xmlbeans.apache.org
> >>>>
> >>>>     
> >>>>         
> >>> Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> >>> For additional commands, e-mail: user-help@xmlbeans.apache.org
> >>>
> >>>
> >>>   
> >>>       
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> >> For additional commands, e-mail: user-help@xmlbeans.apache.org
> >>
> >>     
> >
> > Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail: user-help@xmlbeans.apache.org
> >
> >
> >
> >
> > +----------------------------------------------------------------------+
> > | Z1 SecureMail Gateway Info - http://www.zertificon.com               |
> > +----------------------------------------------------------------------+
> > | - Die Nachricht war weder verschluesselt noch digital unterschrieben |
> > +----------------------------------------------------------------------+
> >
> >
> >   
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: found bug minOccures=0 ignored for xs:any

Posted by Stefan Lischke <s....@zertificon.com>.
I filed this bug to Axis2 [1]

But i want to investigate further, where do i find the schema
information that is used for validation? is it inside the generated
classes or inside the xsb files?

i noticed that there is a small difference in the cadataf932elemtype.xsb
file


---plain xmlbeans version---
binary

_BI_string
-------------------------------------

---axis2&xmlbeans version---
binary
_BI_string
-------------------------------------



[1] http://issues.apache.org/jira/browse/AXIS2-3599
Radu Preotiuc-Pietro wrote:
> In this case, I am afraid I am not very familiar with how Axis2 packages
> XmlBeans, but it does sound surprising that they would change the result
> of compilation in this way. You are going to have to bring this up on
> Axis' mailing list.
>
> Radu
>
> On Wed, 2008-03-12 at 19:18 +0100, Stefan Lischke wrote:
>   
>> Hi,
>>
>> I found out, that it works great if i compile the beans with XMLBeans
>> 2.3.0 only. But when i use Axis2 with XMLBeans the validation fails.
>> I even tried the xmlbeans version that is deliverd with Axis2 with the
>> xmlbeans generated classes and it validates fine. It must be something
>> at the bean generation in combination with Axis2.
>> I took a look at the resolver but could not find anything.
>>
>> I debugged validation process and found that the the SchemaParticleImpl
>> has minoccurs set to 1 when using the axis2+xmlbeans generated  beans.
>>
>> Very strange,
>>
>> any idea?
>>  
>> Radu Preotiuc-Pietro wrote:
>>     
>>> This one too works for me. Only if I change "minOccurs" on the <any> to
>>> "1", I get the error that you are getting. Use the "validate" script
>>> (under bin/) to easily check this.
>>>
>>> Radu
>>>
>>> On Mon, 2008-03-10 at 13:42 +0100, Stefan Lischke wrote:
>>>   
>>>       
>>>> hi,
>>>>
>>>> XMLBeans seems to ignore the minOccurs="0" attribute on xs:any, it
>>>> always expects an element.... very strange:
>>>>
>>>>
>>>> i have the following schema:
>>>> ...
>>>> <xs:element name="CAdata" minOccurs="0" maxOccurs="1">
>>>>                 <xs:complexType>
>>>>                     <xs:sequence>
>>>>                         <xs:any namespace="##other"
>>>> processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
>>>>                     </xs:sequence>
>>>>                     <xs:attribute name="CAname" type="xs:string"
>>>> use="required"/>
>>>>                     <xs:attribute name="value" type="xs:string"
>>>> use="optional"/>
>>>>                  </xs:complexType>
>>>>             </xs:element>
>>>> ...
>>>>
>>>> and the following instance:
>>>>
>>>> junit.framework.AssertionFailedError: EntityManagerException 'XML Format
>>>> of KeyCertPair is not valid.
>>>> error: cvc-complex-type.2.4d: Expected element(s) in element
>>>> CAdata@http://www.zertificon.com/erpconnector/v1/entity_management
>>>>
>>>> <X>
>>>> ...
>>>>   <CAdata value="ich bin die id" CAname="testCA"/>
>>>> ...
>>>> </X>
>>>>
>>>> And .validate() fails with
>>>>
>>>> 'XML Format of KeyCertPair is not valid.
>>>> error: cvc-complex-type.2.4d: Expected element(s) in element
>>>> CAdata@http://www........
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>>>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>>>
>>>>     
>>>>         
>>> Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>>
>>>
>>>   
>>>       
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>     
>
> Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>
>
>
> +----------------------------------------------------------------------+
> | Z1 SecureMail Gateway Info - http://www.zertificon.com               |
> +----------------------------------------------------------------------+
> | - Die Nachricht war weder verschluesselt noch digital unterschrieben |
> +----------------------------------------------------------------------+
>
>
>   



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: found bug minOccures=0 ignored for xs:any

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
In this case, I am afraid I am not very familiar with how Axis2 packages
XmlBeans, but it does sound surprising that they would change the result
of compilation in this way. You are going to have to bring this up on
Axis' mailing list.

Radu

On Wed, 2008-03-12 at 19:18 +0100, Stefan Lischke wrote:
> Hi,
> 
> I found out, that it works great if i compile the beans with XMLBeans
> 2.3.0 only. But when i use Axis2 with XMLBeans the validation fails.
> I even tried the xmlbeans version that is deliverd with Axis2 with the
> xmlbeans generated classes and it validates fine. It must be something
> at the bean generation in combination with Axis2.
> I took a look at the resolver but could not find anything.
> 
> I debugged validation process and found that the the SchemaParticleImpl
> has minoccurs set to 1 when using the axis2+xmlbeans generated  beans.
> 
> Very strange,
> 
> any idea?
>  
> Radu Preotiuc-Pietro wrote:
> > This one too works for me. Only if I change "minOccurs" on the <any> to
> > "1", I get the error that you are getting. Use the "validate" script
> > (under bin/) to easily check this.
> >
> > Radu
> >
> > On Mon, 2008-03-10 at 13:42 +0100, Stefan Lischke wrote:
> >   
> >> hi,
> >>
> >> XMLBeans seems to ignore the minOccurs="0" attribute on xs:any, it
> >> always expects an element.... very strange:
> >>
> >>
> >> i have the following schema:
> >> ...
> >> <xs:element name="CAdata" minOccurs="0" maxOccurs="1">
> >>                 <xs:complexType>
> >>                     <xs:sequence>
> >>                         <xs:any namespace="##other"
> >> processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
> >>                     </xs:sequence>
> >>                     <xs:attribute name="CAname" type="xs:string"
> >> use="required"/>
> >>                     <xs:attribute name="value" type="xs:string"
> >> use="optional"/>
> >>                  </xs:complexType>
> >>             </xs:element>
> >> ...
> >>
> >> and the following instance:
> >>
> >> junit.framework.AssertionFailedError: EntityManagerException 'XML Format
> >> of KeyCertPair is not valid.
> >> error: cvc-complex-type.2.4d: Expected element(s) in element
> >> CAdata@http://www.zertificon.com/erpconnector/v1/entity_management
> >>
> >> <X>
> >> ...
> >>   <CAdata value="ich bin die id" CAname="testCA"/>
> >> ...
> >> </X>
> >>
> >> And .validate() fails with
> >>
> >> 'XML Format of KeyCertPair is not valid.
> >> error: cvc-complex-type.2.4d: Expected element(s) in element
> >> CAdata@http://www........
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> >> For additional commands, e-mail: user-help@xmlbeans.apache.org
> >>
> >>     
> >
> > Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail: user-help@xmlbeans.apache.org
> >
> >
> >   
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: found bug minOccures=0 ignored for xs:any

Posted by Stefan Lischke <s....@zertificon.com>.
Hi,

I found out, that it works great if i compile the beans with XMLBeans
2.3.0 only. But when i use Axis2 with XMLBeans the validation fails.
I even tried the xmlbeans version that is deliverd with Axis2 with the
xmlbeans generated classes and it validates fine. It must be something
at the bean generation in combination with Axis2.
I took a look at the resolver but could not find anything.

I debugged validation process and found that the the SchemaParticleImpl
has minoccurs set to 1 when using the axis2+xmlbeans generated  beans.

Very strange,

any idea?
 
Radu Preotiuc-Pietro wrote:
> This one too works for me. Only if I change "minOccurs" on the <any> to
> "1", I get the error that you are getting. Use the "validate" script
> (under bin/) to easily check this.
>
> Radu
>
> On Mon, 2008-03-10 at 13:42 +0100, Stefan Lischke wrote:
>   
>> hi,
>>
>> XMLBeans seems to ignore the minOccurs="0" attribute on xs:any, it
>> always expects an element.... very strange:
>>
>>
>> i have the following schema:
>> ...
>> <xs:element name="CAdata" minOccurs="0" maxOccurs="1">
>>                 <xs:complexType>
>>                     <xs:sequence>
>>                         <xs:any namespace="##other"
>> processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
>>                     </xs:sequence>
>>                     <xs:attribute name="CAname" type="xs:string"
>> use="required"/>
>>                     <xs:attribute name="value" type="xs:string"
>> use="optional"/>
>>                  </xs:complexType>
>>             </xs:element>
>> ...
>>
>> and the following instance:
>>
>> junit.framework.AssertionFailedError: EntityManagerException 'XML Format
>> of KeyCertPair is not valid.
>> error: cvc-complex-type.2.4d: Expected element(s) in element
>> CAdata@http://www.zertificon.com/erpconnector/v1/entity_management
>>
>> <X>
>> ...
>>   <CAdata value="ich bin die id" CAname="testCA"/>
>> ...
>> </X>
>>
>> And .validate() fails with
>>
>> 'XML Format of KeyCertPair is not valid.
>> error: cvc-complex-type.2.4d: Expected element(s) in element
>> CAdata@http://www........
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>     
>
> Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>
>   



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: found bug minOccures=0 ignored for xs:any

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
This one too works for me. Only if I change "minOccurs" on the <any> to
"1", I get the error that you are getting. Use the "validate" script
(under bin/) to easily check this.

Radu

On Mon, 2008-03-10 at 13:42 +0100, Stefan Lischke wrote:
> hi,
> 
> XMLBeans seems to ignore the minOccurs="0" attribute on xs:any, it
> always expects an element.... very strange:
> 
> 
> i have the following schema:
> ...
> <xs:element name="CAdata" minOccurs="0" maxOccurs="1">
>                 <xs:complexType>
>                     <xs:sequence>
>                         <xs:any namespace="##other"
> processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
>                     </xs:sequence>
>                     <xs:attribute name="CAname" type="xs:string"
> use="required"/>
>                     <xs:attribute name="value" type="xs:string"
> use="optional"/>
>                  </xs:complexType>
>             </xs:element>
> ...
> 
> and the following instance:
> 
> junit.framework.AssertionFailedError: EntityManagerException 'XML Format
> of KeyCertPair is not valid.
> error: cvc-complex-type.2.4d: Expected element(s) in element
> CAdata@http://www.zertificon.com/erpconnector/v1/entity_management
> 
> <X>
> ...
>   <CAdata value="ich bin die id" CAname="testCA"/>
> ...
> </X>
> 
> And .validate() fails with
> 
> 'XML Format of KeyCertPair is not valid.
> error: cvc-complex-type.2.4d: Expected element(s) in element
> CAdata@http://www........
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org