Réf. : RE: Problem with boolean type
Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour : user@xmlbeans.apache.org cc : Objet : RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name=mustUnderstand xs:simpleType xs:restriction base=xs:boolean xs:pattern value=0|1/ /xs:restriction /xs:simpleType /xs:attribute Xbean generates the following accessors : void setMustUnderstand(boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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.
Re: Réf. : RE: Problem with boolean type
I recently had a similar problem. A schema defines an element thusly: xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ When calling the generated interface: d.setDayWorking(true); XMLBeans then writes: DayWorkingtrue/DayWorking However, the application reading the XML instance (which is out of my control) needs it to be: DayWorking1/DayWorking My work-around was to revise the schema to declare the element type as an integer, regenerate the library. It would be nice, though if there was a way of optionally directing to the boolean type setter method to write the value as a numeric value. Cheers, Albert At 05:16 AM 10/10/2007, you wrote: Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew -- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name=mustUnderstand xs:simpleType xs:restriction base=xs:boolean xs:pattern value=0|1/ /xs:restriction /xs:simpleType /xs:attribute Xbean generates the following accessors : void setMustUnderstand(boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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.
RE: Réf. : RE: Problem with boolean type
It is not a bug, as Dennis said in a previous email, XMLBeans and binding tools in general, try to do the right thing in many cases, but this is not one of them. Even if this Boolean restriction seems simple enough, to support all restrictions is impossible. Check out the following example on how to use 0/1 instead of true/false for a Boolean type: XmlBoolean xb = XmlBoolean.Factory.newInstance(); xb.setStringValue(1); XmlObject xo = XmlObject.Factory.parse(a/); System.out.println( xo: + xo); XmlObject axo = xo.selectChildren(, a)[0]; axo.set(xb); System.out.println( xo: + xo); Cezar From: Wing Yew Poon [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 1:27 PM To: user@xmlbeans.apache.org Subject: RE: Réf. : RE: Problem with boolean type Then that is a bug. You can file a bug in JIRA. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 2:16 AM To: user@xmlbeans.apache.org Subject: Réf. : RE: Problem with boolean type Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name=mustUnderstand xs:simpleType xs:restriction base=xs:boolean xs:pattern value=0|1/ /xs:restriction /xs:simpleType /xs:attribute Xbean generates the following accessors : void setMustUnderstand(boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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. 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. 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.
RE: Réf. : RE: Problem with boolean type
This one is not a bug. true and 1 are both valid values for the schema type. When XMLBeans writes the xml, it uses the canonical lexical representation, which is true. From: Albert Bupp [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 8:46 AM To: user@xmlbeans.apache.org Subject: Re: Réf. : RE: Problem with boolean type I recently had a similar problem. A schema defines an element thusly: xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ When calling the generated interface: d.setDayWorking( true ); XMLBeans then writes: DayWorkingtrue/DayWorking However, the application reading the XML instance (which is out of my control) needs it to be: DayWorking1/DayWorking My work-around was to revise the schema to declare the element type as an integer, regenerate the library. It would be nice, though if there was a way of optionally directing to the boolean type setter method to write the value as a numeric value. Cheers, Albert At 05:16 AM 10/10/2007, you wrote: Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name= mustUnderstand xs:simpleType xs:restriction base= xs:boolean xs:pattern value= 0|1 / / xs:restriction / xs:simpleType / xs:attribute Xbean generates the following accessors : void setMustUnderstand( boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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. 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.
RE: Réf. : RE: Problem with boolean type
Please see what Cezar wrote on this thread. I guess to do what you want (without changing your schema), you can use the generated xsetter instead of the setter. So - for xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ you can set it by XmlBoolean xb = XmlBoolean.Factory.newInstance(); xb.setStringValue(1); d.xsetDayWorking(xb); From: Albert Bupp [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 12:08 PM To: user@xmlbeans.apache.org Subject: RE: Réf. : RE: Problem with boolean type I agree that it's not a bug, however, it would be helpful if there were a way to direct the setter as to the form to output the value in, as either true or 1, since both are legitimate boolean representations. At 03:04 PM 10/10/2007, you wrote: This one is not a bug. true and 1 are both valid values for the schema type. When XMLBeans writes the xml, it uses the canonical lexical representation, which is true. From: Albert Bupp [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Wednesday, October 10, 2007 8:46 AM To: user@xmlbeans.apache.org Subject: Re: Réf. : RE: Problem with boolean type I recently had a similar problem. A schema defines an element thusly: xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ When calling the generated interface: d.setDayWorking( true ); XMLBeans then writes: DayWorkingtrue/DayWorking However, the application reading the XML instance (which is out of my control) needs it to be: DayWorking1/DayWorking My work-around was to revise the schema to declare the element type as an integer, regenerate the library. It would be nice, though if there was a way of optionally directing to the boolean type setter method to write the value as a numeric value. Cheers, Albert At 05:16 AM 10/10/2007, you wrote: Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name= mustUnderstand xs:simpleType xs:restriction base= xs:boolean xs:pattern value= 0|1 / / xs:restriction / xs:simpleType / xs:attribute Xbean generates the following accessors : void setMustUnderstand( boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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. 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
RE: Réf. : RE: Problem with boolean type
I agree that it's not a bug, however, it would be helpful if there were a way to direct the setter as to the form to output the value in, as either true or 1, since both are legitimate boolean representations. At 03:04 PM 10/10/2007, you wrote: This one is not a bug. true and 1 are both valid values for the schema type. When XMLBeans writes the xml, it uses the canonical lexical representation, which is true. -- From: Albert Bupp [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 8:46 AM To: user@xmlbeans.apache.org Subject: Re: Réf. : RE: Problem with boolean type I recently had a similar problem. A schema defines an element thusly: xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ When calling the generated interface: d.setDayWorking( true ); XMLBeans then writes: DayWorkingtrue/DayWorking However, the application reading the XML instance (which is out of my control) needs it to be: DayWorking1/DayWorking My work-around was to revise the schema to declare the element type as an integer, regenerate the library. It would be nice, though if there was a way of optionally directing to the boolean type setter method to write the value as a numeric value. Cheers, Albert At 05:16 AM 10/10/2007, you wrote: Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew -- From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name= mustUnderstand xs:simpleType xs:restriction base= xs:boolean xs:pattern value= 0|1 / / xs:restriction / xs:simpleType / xs:attribute Xbean generates the following accessors : void setMustUnderstand( boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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. 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.
Re: Réf. : RE: Problem with boolean type
would restricting it via an enumeration work for you Albert? -Jacobd On 10/10/07, Wing Yew Poon [EMAIL PROTECTED] wrote: This one is not a bug. true and 1 are both valid values for the schema type. When XMLBeans writes the xml, it uses the canonical lexical representation, which is true. -- *From:* Albert Bupp [mailto:[EMAIL PROTECTED] *Sent:* Wednesday, October 10, 2007 8:46 AM *To:* user@xmlbeans.apache.org *Subject:* Re: Réf. : RE: Problem with boolean type I recently had a similar problem. A schema defines an element thusly: xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ When calling the generated interface: d.setDayWorking( *true* ); XMLBeans then writes: DayWorkingtrue/DayWorking However, the application reading the XML instance (which is out of my control) needs it to be: DayWorking1/DayWorking My work-around was to revise the schema to declare the element type as an integer, regenerate the library. It would be nice, though if there was a way of optionally directing to the boolean type setter method to write the value as a numeric value. Cheers, Albert At 05:16 AM 10/10/2007, you wrote: Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie *Wing Yew Poon [EMAIL PROTECTED]* 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew -- *From:* [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED][EMAIL PROTECTED]] * Sent:* Tuesday, October 09, 2007 6:53 AM* To:* [EMAIL PROTECTED] Subject:* Problem with boolean type I have the following schema element : xs:attribute name= mustUnderstand xs:simpleType xs:restriction base= xs:boolean xs:pattern value= 0|1 / / xs:restriction / xs:simpleType / xs:attribute Xbean generates the following accessors : *void* setMustUnderstand( *boolean* mustUnderstand); *boolean* getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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. 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.
RE: Réf. : RE: Problem with boolean type
I see. Thanks for the incite into the library. I hadn't realized that the I could invoke xsetfoobar on a given setter. At 03:22 PM 10/10/2007, you wrote: Please see what Cezar wrote on this thread. I guess to do what you want (without changing your schema), you can use the generated xsetter instead of the setter. So - for xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ you can set it by XmlBoolean xb = XmlBoolean.Factory.newInstance(); xb.setStringValue(1); d.xsetDayWorking(xb); -- From: Albert Bupp [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 12:08 PM To: user@xmlbeans.apache.org Subject: RE: Réf. : RE: Problem with boolean type I agree that it's not a bug, however, it would be helpful if there were a way to direct the setter as to the form to output the value in, as either true or 1, since both are legitimate boolean representations. At 03:04 PM 10/10/2007, you wrote: This one is not a bug. true and 1 are both valid values for the schema type. When XMLBeans writes the xml, it uses the canonical lexical representation, which is true. -- From: Albert Bupp [ mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 8:46 AM To: user@xmlbeans.apache.org Subject: Re: Réf. : RE: Problem with boolean type I recently had a similar problem. A schema defines an element thusly: xsd:element name=DayWorking type=xsd:boolean minOccurs=0/ When calling the generated interface: d.setDayWorking( true ); XMLBeans then writes: DayWorkingtrue/DayWorking However, the application reading the XML instance (which is out of my control) needs it to be: DayWorking1/DayWorking My work-around was to revise the schema to declare the element type as an integer, regenerate the library. It would be nice, though if there was a way of optionally directing to the boolean type setter method to write the value as a numeric value. Cheers, Albert At 05:16 AM 10/10/2007, you wrote: Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew -- From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name= mustUnderstand xs:simpleType xs:restriction base= xs:boolean xs:pattern value= 0|1 / / xs:restriction / xs:simpleType / xs:attribute Xbean generates the following accessors : void setMustUnderstand( boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct it? 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. 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. 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.