Thanks Jorg for your help...
Just run that line you asked for....
C:\Users\dale.ellis.SKY>java -cp
M:\com\thoughtworks\xstream\xstream\1.4.5\xstream-1.4.5.jar
com.thoughtworks.xstream.core.JVM
XStream JVM diagnostics
java.specification.version: 1.6
java.specification.vendor: Sun Microsystems Inc.
java.specification.name: Java Platform API Specification
java.vm.vendor: Sun Microsystems Inc.
java.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
Version: 1.6
XStream support for enhanced Mode: true
Supports AWT: true
Supports Swing: true
Supports SQL: true
Standard StAX XMLInputFactory: com.sun.xml.internal.stream.XMLInputFactoryImpl
Standard StAX XMLOutputFactory: com.sun.xml.internal.stream.XMLOutputFactoryImpl
Optimized TreeSet.addAll: true
Optimized TreeMap.putAll: true
Can parse UTC date format: true
Reverse field order detected (only if JVM class itself has been compiled): false
I just tried the IS references mode, not exactly sure what I was doing, but
seemed to generate the xml with ids instead of the xpath's so guess it worked ok
xStream.setMode(XStream.ID_REFERENCES);
xStream.aliasSystemAttribute("xstreamId", "xstreamId");
Still have the same issue though, stripping out the <id>'s freezes for
fromXml() still :o(
Any other suggestions?, I'm going to have a look through the xstream
documentation to try get a better understanding of whats going on, I'm
wondering if I can write a custom converter to strip out id values, all objects
with the id extend AbstractEntity so maybe I can do something with that.
Thanks
Dale Ellis
-----Original Message-----
From: Jörg Schaible [mailto:[email protected]]
Sent: 07 November 2013 11:48
To: [email protected]
Subject: [xstream-user] RE: Re: Converting an object back from XML
Hello Dale,
Dale Ellis wrote:
> Thanks for your replies guys,
>
> Apologies, should of thought to include version information.
>
> I'm using JDK 1.6 and xstream is version 1.4.5, pulled in via maven
> dependency...
>
> <dependency>
> <groupId>com.thoughtworks.xstream</groupId>
> <artifactId>xstream</artifactId>
> <version>1.4.5</version>
> </dependency>
>
> It did occur to me too that it might be related to the sets, maybe a
> compareTo() method is referencing an ID attribute which is getting it
> in a muddle but the ones I checked yesterday seem to order by sequence
> attributes or name attributes, I'll look further.
If the TreeSetConverter can use its optimized mode, then the compareTo is not
called, but I cannot know without knowing Java version and vendor. For your
environment it should work without.
> Also, I'll try different mode and see what happens, and let you know,
> hopefully will solve issue.
For ID mode you have to set a system alias for "id", because you have members
of this name on your own. At least it will strip down the long references at
the end of your file to a plain number.
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email