To rename class="..." to xsi:type="...", you can use this:
xstream.aliasSystemAttribute("xsi:type", "class");
However, you'll still need to include the custom xmlns:xsi="http://..."
attribute yourself. You can do this in the Java code my manipulating the
resulting document.
Hope that solves the issue.
thanks
-Joe
On Wed, Sep 5, 2012 at 9:50 AM, Massimo Ugues <[email protected]> wrote:
> Hallo all.
> I need to change the attribute name that xstream uses for referencing
> complex types.
> Imagine this xml:
>
> <message>
> <payload class="giroconto-request">
> <contoAddebito class="conto-corrente">
>
> I need to change it with this one
>
> <message>
> <payload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="giroconto-request">
> <contoAddebito xsi:type="conto-corrente">
> <codiceServizio>codiceServizio</codiceServizio>
>
> Is there any elegant way to achieve this? (without having to replace it
> with some java code).
>
> Kind regards
> Massimo
>
> --
> Massimo Ugues
> http://m4zi.wordpress.com/
> jabber: [email protected]
> skype: m.ugues
>