|
From: LeeHyung J. - K. <pro...@ho...> - 2012-02-13 04:44:53
|
Hi all.
I'm using XStream.
I have a problem to get value in xml configuration file.
My xml file is below:
<a>
<b id="1">
<c type="abc">
<c-1>test</c-1>
<c-2>sample</c-2>
</c>
</b>
<b id="2">
<c type="123">
<c-1>test</c-1>
<c-2>sample</c-2>
</c>
</b>
</a>
My beans are :
<bean id="XMLConverter" class="presence.test.XMLConverter">
<property name="marshaller" ref="xstreamMarshaller" />
<property name="unmarshaller" ref="xstreamMarshaller" />
</bean>
<bean id="xstreamMarshaller" class="org.springframework.oxm.xstream.XStreamMarshaller">
<property name="aliases">
<map>
<entry key="a" value="org.procarrie.A" />
</map>
</property>
<property name="useAttributeFor">
<map>
<entry key="id">
<value type="java.lang.Class">java.lang.String</value>
</entry>
<entry key="type">
<value type="java.lang.Class">java.lang.String</value>
</entry>
</map>
</property>
</bean>
package org.procarrie;
public class A {
B b = null;
public void setB(B b) {
this.b = b;
}
public B getB() {
return b;
}
public String toString() {
return b.toString();
}
}
how can read configuration value more than one?
Thanks in advanced
Best Regards
Kevin Lee.
|