Mark Dathorne

Greenhorn
+ Follow
since Oct 21, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Dathorne

Done ...

<class name="com.xxx.GetSalesResponse">
<map-to xml="GetSalesResponse" />
<field name="status" type="java.lang.String">
<bind-xml name="status" node="attribute" location="GetSalesResponse/GetSalesReturn/company" />
</field>

<field name="sales"
collection="arraylist"
type="com.xxx.Sale">
<bind-xml name="sale" node="element" location="GetSalesResponse/GetSalesReturn/company/sales"/>
</field>
</class>
[ August 21, 2008: Message edited by: Mark Dathorne ]
Hi guys,
How can I replicate the xml output to be like this:

<GetSalesResponse>
<GetSalesReturn>
<company status="ok">
<sales>
<sale>
<SaleID>xxxxx</SaleID>
<SaleDate>2008-08-07 10:11:12.0</SaleDate>
<SaleValue>1.00</SaleValue>
</sale>
</sales>
</company>
<GetSalesReturn>
</GetSalesResponse>


Given the following definition in mapping.xml:
..........
<class name="com.xxx.GetSalesResponse">
<map-to xml="company" />
<field name="status" type="java.lang.String">
<bind-xml name="status" node="attribute" />
</field>

<field name="sales"
collection="arraylist"
type="com.xxx.Sale" container="false">
<bind-xml name="sales" node="element"/>
</field>
</class>

<class name="com.xxx.Sale">
<map-to xml="sale" />
<field name="saleId" type="string">
<bind-xml name="saleId" node="element" />
</field>
<field name="saleDate" type="string">
<bind-xml name="saleDate" node="element" />
</field>
<field name="saleValue" type="string">
<bind-xml name="saleValue" node="element" />
</field>
</class>
...............

This structure currently gives something like the following:

<company status="ok">
<sales>
<sale>
<SaleID>xxxxx</SaleID>
<SaleDate>2008-08-07 10:11:12.0</SaleDate>
<SaleValue>1.00</SaleValue>
</sale>
</sales>
</company>


I am looking to replace a legacy web service so the design
is out of my hands.

Kind regards,

Mark
I'm afraid there is no short cut answer for this.

Try and get hold of the really great book Spring in Action (2nd Edition) and you'll be up and running in no time at all.

Mark Dathorne
Java Persistence with Hibernate

It's out PDF ebook and paperback.
Thanks very much, Paul.
16 years ago
I use FileOutputStream to create an Excel file using POI.

Trouble is this creates a physical file in [JBOSS_LIB]/bin
How can I create the same file in memory instead?

cheers.
16 years ago