You can disable xsi:type output as such:
Marshaller m = new Marshaller(writer);
m.setSupressXSIType(true);
m.marshal(listaPersons);
But be careful, by disabling the xsi:type, Castor may not be able to
unmarshal if it can't automatically determine the element->java type
mapping.
--Keith
Hugo Rucha wrote:
>
> Hi, i have a ArrayList with some classes in it, and when I do the
> marshalling, the xml file put the XSI:type. What i want to know is if
> it's possible to disable xsi:type attributes.
>
> Ex:
>
> ListaPersons listaPersons = new ListaPersons();
> person = new Person("Ryan 'Mad Dog' Madden");
> person.setDateOfBirth(new Date(1955, 8, 15));
> listaPersons.addDeclaracao(person);
> person = new Person("Bryan 'Good Dog' Madden");
> person.setDateOfBirth(new Date(1955, 8, 15));
>
> And my xml file stays like this:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <lista-persons>
>
> <persons xsi:type="java:ab.ab.ab.ab.ab.Person"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
> <name>Ryan 'Mad Dog' Maddeno</name>
>
> <date-of-birth>3855-09-15T00:00:00.000+01:00</date-of-birth>
>
> </persons>
>
> <persons xsi:type="java:ab.ab.ab.ab.ab.Person"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
> <name>Bryan 'Good Dog' Maddeno</name>
>
> <date-of-birth>3855-09-15T00:00:00.000+01:00</date-of-birth>
>
> </persons>
>
> </lista-persons>
>
> ----------------------------------------------------------------------
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> ----------------------------------------------------------- If you
> wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev