The example you posted as to what you would like it to look like isn't really xml at all, just a single xml tag with html inside.
Really with XML you would write the data like how it is output already, then you would have something else be it a website or a piece of software which can parse that data and display it / use it as required. Also, you might want to check the spelling on your example, I would hope "dognuts" aren't a food item on the menu ;) On 14 March 2011 09:40, rakeshyadav rakeshyadav <[email protected]>wrote: > HI All, > > > i am trying to generate XML template on my report generated > data. > > the stuff related to generate XML i keep in view page as below. > > <?php > > //example i am pushing data to $Data > > $Data = array('storetype' => $store['st']['store_type']); > > > App::import('Helper', 'Xml'); > App::import('Core', 'File'); > $xml = new XmlHelper(); > > $file = $xml->header(); // We need the XML header before our data. > $file .= $xml->serialize($Data, array('whitespace' => true)); > > // Write the file. > $xmlFile =new File('/tmp' .'/filename.xml'); > $xmlFile->write($file, 'w'); > $xmlFile->close(); > > ?> > > for this i am getting out put as below > > <?xml version="1.0" encoding="UTF-8" ?> > <std_class subcategorys="Cake , biscuits, dognuts" /> > <std_class storetype="Checkers" /> > <std_class banchcode="262" /> > <std_class branchname="CC LADYSMITH - OVAL" /> > <std_class bookedDates="" /> > > (But this is not the way i want result). > > i want to generate templet file example as below > > <report-contents> > > <th> > <tr> > <text align="center"> > Sub Category-1 > </text> > <td> > Store Type > </td> > <td> > Branch Code > </td> > <td> > Branch Name > </td> > <td> > Dates Booked > </td> > <td align="left" > Dates Available > </td> > </tr> > </th> > > <tr> > <td> > Checkers Hyper > </td> > <td> > 6983 > </td> > <td> > CH HY Centurion > </td> > <td> > </td> > <td align="left" > 15-02-2011,14-03-2013, > </td> > </tr> > > <tr> > <td =bgclor="red'> > DELI > </td> > </tr> > > </report-contents> > > can any one worked on this type of solution please suggest me the right way > to archive. > > Thanks in Advance , > > Rakesh > > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group > at http://groups.google.com/group/cake-php > -- Kind Regards Stephen http://www.ninjacodermonkey.co.uk -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
