ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Custom XML Resultmaps
Date Thu, 12 May 2005 15:30:16 GMT
Do you want to have IBatis generate an xml file that can be loaded by a
DataSet's ReadXml method? Here's an example for the non-.Net people of
one way of saving a DataSet to XML:

 DataSet ds = new DataSet("People");

 DataTable dt = new DataTable("Person");
 dt.Columns.Add("Name", typeof(string));
 dt.Columns.Add("Age", typeof(int));
			
 DataRow dr = dt.NewRow();
 dr["Name"] = "Ron";
 dr["Age"] = "99";
 dt.Rows.Add(dr);
			
 ds.Tables.Add(dt);

 ds.WriteXml("output.xml");

 <People>
   <Person>
     <Name>Ron</Name>
     <Age>99</Age>
   </Person>
 </People>

Except for the outer <People> node, I believe IBatis can generate that
already.

--- Abdullah Kauchali <abdullah.kauchali@isanusi.com> wrote:
> Is it possible to extend the current XML Resultmap format to a new 
> custom one?  Don't ask!, but were are investigating the possibility
> of 
> returning XML in Microsoft's ADO format.
> 
> Any general advice on this would be greatly appreciated,
> 
> Kind regards
> 
> Abdullah
> 

Mime
View raw message