Namespace id attributes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Namespace id attributes

Geoffrey De Smet
I am using
   xStream.setMode(XStream.ID_REFERENCES);
But some of my classes have a @XStreamAsAttribute field called "id".


So I get output like this:
   <entitySelector id="8" id="placerEntitySelector">

Can I namespace the xstream id attribute somehow, so I get this instead:
    <entitySelector xstream:id="8" id="placerEntitySelector">


Thanks,
Geoffrey


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Namespace id attributes

Jörg Schaible-4
Hi Geoffrey,

Geoffrey De Smet wrote:

> I am using
>    xStream.setMode(XStream.ID_REFERENCES);
> But some of my classes have a @XStreamAsAttribute field called "id".
>
>
> So I get output like this:
>    <entitySelector id="8" id="placerEntitySelector">
>
> Can I namespace the xstream id attribute somehow, so I get this instead:
>     <entitySelector xstream:id="8" id="placerEntitySelector">

No, XStream uses the default namespace and none of its XML parsers are
actually configured to actually support namespaces (except of the StaxDriver
and derived).

However, you can set a systemAlias to use a different attribute name.

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email