users@jaxb.java.net

RE: Suppressing xsi:type information

From: Johendran, Aravindh <aravindh.johendran_at_wachovia.com>
Date: Mon, 30 Apr 2007 13:15:54 -0400

If I use the XMLTransient annotation, it is not printing out the values
at all. And the type info is still there.

Is it possible at all to suppress the type info?

 

 

________________________________

From: Bradley Rintoul [mailto:brintoul_at_sbcglobal.net]
Sent: Thursday, April 26, 2007 12:50 AM
To: users_at_jaxb.dev.java.net
Subject: Re: Suppressing xsi:type information

 


I'm usually just a lurker here, but I'll give this a shot - hopefully if
I'm wrong someone will correct me...

I think you can use the XmlTransient annotation on the properties in
question... maybe look into its usage.

"Johendran, Aravindh" <aravindh.johendran_at_wachovia.com> wrote:

Hi,

    Thanks for creating and maintaining JAXB. The Java code it generates
from the xsd is quite cool and overall it is a great tool.

I have a quick question. Is there a way to suppress the xsi:type
information in the marshaled xml file? JAXB automatically generates type
info when there is a base class/subclass relationship. It makes sense.
However, the people who are using the XML file we generate do not want
the type info. They provided us with the XSD and for that XSD JAXB
generates the type info at relevant places.

 

We are generating some huge xml files and it will be great if the type
info can be suppressed since it is not being used.

 

For example, I'd like to suppress the generation of
xsi:type="attrString", xsi:type="list" and so on during marshalling.

 

<Attribute>

            <Name>Early Termination Schedule</Name>

            <Value xsi:type="list">

                        <List>

                                    <Item>

                                                <Attribute
xsi:type="attrString">

                                                            <Name>Early
Termination Type</Name>

 
<Value>Credit</Value>

                                                </Attribute>

                                                <Attribute
xsi:type="attrDate">

                                                            <Name>Early
Termination Date</Name>

 
<Value>08JAN1970</Value>

                                                </Attribute>

                                    </Item>

                        </List>

            </Value>

</Attribute>