well,

as far as I understood,
the xsi:type usually appears when the type is not stricly defined
(for example to enable subtyping of elements), I suspect that your
schema is too strict. In my case, xsi:type appears correctly;
here is an extract of the schema I am using:
../..

<complexType name="ContentType" mixed="false">
<sequence>
<element name="Attribute" type="xac:AbstractAttributeType" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="AbstractAttributeType" abstract="true" mixed="false">
<annotation>
<documentation>A very simple attribute, inheritance root for all
attributes</documentation>
</annotation>
<sequence>
../...
</sequence>
</complexType>
<complexType name="AttributeType">
<annotation>
<documentation>Its first descendant</documentation>
</annotation>
<complexContent>
<extension base="xac:AbstractAttributeType"/>
</complexContent>
</complexType>
../...
Hope this may help you
jc

> I am really hoping that this a pretty simple question. I am new to
> XmlBeans, this is the first project that I have used it on so far.
>
> Anyway, what I would like to see in the resulting xml is something
> like the following:
>
> <om:result xsi:type=”xsi:boolean”>false</om:result>
>
> The om:result element is an instance of XmlComplexContentImpl, I have
> tried to use the XmlComplexContentImpl.set(boolean booleanValue) but I
> get an exception every time. I then attempted the following code:
>
> boolean boolResult = Boolean.getBoolean(measure.getResult());
> XmlBoolean xmlBoolean = XmlBoolean.Factory.newInstance();
> xmlBoolean.setBooleanValue(boolResult);
> complexContent.set(xmlBoolean);
> complexContent.changeType(XmlBoolean.type);
>
> This code will set the value to a boolean value, however the xsi:type
> attribute will not appear therefore I get the following xml
>
> <om:result>false</om:result>
>
> Could anyone please tell me if it is possible to force the xsi:type
> attribute to appear?
>
> Thank you very much,
> Doug
>


-- 
Jean-Christophe Pazzaglia, PhD <[EMAIL PROTECTED]>
Corporate communications
Tel: (+33) 4-93-00-26-78 
PGP Key available : http://www.eurecom.fr/~pazzagli/publickey.pgp
--
Institut Eurécom - Office 029
http://www.eurecom.fr/
2229 Route des Crêtes 
BP 193 
06904 Sophia Antipolis, France
Fax: (+33) 4-93-00-26-27

















---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to