I am using Xstream instance with ID_REFERENCES (because need those further down the xml file).

I read an XML format like this:

<benchmark>
  <solver>
    <entityClass>org.foo.Bar</entityclass>
  </solver>
  <solver>
    <entityClass>org.foo.Bar</entityclass>
  </solver>
<benchmark>

When I try to write it, I get different output:

<benchmark>
  <solver>
    <entityClass id="7">org.foo.Bar</entityclass>
  </solver>
  <solver>
    <entityClass ref="7"/>
  </solver>
<benchmark>

My model looks like this:

@XstreamAlias("solver")
class Solver {

    @XstreamAlias("entityClass")
    Class<?> entityClass;

}

How do I make my write format the same as my read format?


==========
Second question (more advanced form)
==========

Actually, my entity model looks like this:

@XstreamAlias("solver")
class Solver {

    @XStreamImplicit(itemFieldName = "entityClass")
    protected List<Class<?>> entityClassList;

}

The XML input is the same.
During XML output it throws "ReferencedImplicitElementException: Cannot reference implicit element"
because it uses refs for the Class fields.
I 'd like it not to use id-references for those fields to avoid that exception.


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

   http://xircles.codehaus.org/manage_email


Reply via email to