another way is also to do this xmlTransformer.aliasSystemAttribute(null, "class");
Cheers On Fri, Mar 1, 2013 at 3:54 PM, DJDaveMark <[email protected]> wrote: > Hi everyone, > > I've just started using XStream and once I got my XML output as I wanted > it, I came across the following attribute: > > class="sorted-set" > > I searched the site for how to remove it but didn't find anything. I'd > like to suggest an addition to the site's FAQ section: > > === How can I remove the class attribute from collection tags === > One way to remove it is to declare your collection using the concrete > class instead of the interface i.e.: > private TreeSet<Foo> dependencies = new TreeSet<Foo>(); > ...instead of... > private Set<Dependency> dependencies = new TreeSet<Dependency>(); > > Cheers, > DaveMark > . >
