Home  /  Questions  /  Question



88   96.5
May 02, 2011


Which pattern should I use to create an XML Request?

Hi,

I have a question for the community.
I need to generate the following XML (see below) to issue a request.
Which pattern should I use to create this Xml request, without using Composite Pattern?

 <Customer>
      <Person>
           <Age1/>
           <Age2/>          
      </Person>
       <Address>
            <Location/>
            <City/>
            <Country/>
      </Address> 
</Customer>


I know I could create a Customer class containing a Person and an Address class and then serialize it to XML.
However, how can I create this XML using a pattern?  And which pattern should I use?

Thanks.



85   96.4
May 07, 2011
Iterator can be applicable here.

--
Kaushal
http://kaushalp.blogspot,com