The parser is complaining because there's a tag mismatch. It may be worth rendering to a variable and writing it to the log to see what Cake is outputting. Or setting $this->layout to false and then sending a Content-type: text/plain header first to keep the browser from attempting to parse the output.
I don't understand why you would want to output XML for your add action, though. On Sun, May 20, 2012 at 11:26 AM, Cara <cblack....@gmail.com> wrote: > I am trying to write what should be a simple API using CakePHP's REST > with XML. > > The code I have is very basic, still not working. I realize it is > very likely a simple thing like file extension or path to file, but I > am very new to REST and limited when using XML. any help would be > greatly appreciated. > > Here is my error > XML Parsing Error: mismatched tag. Expected: </div>. > Location: http://member.ozonefit.com/users/add.xml > Line Number 62, Column 4: </body> > ----------^ > > Here are the files > Routes > Router::mapResources('users'); > Router::parseExtensions('xml'); > > Users Controller > var $components = array('RequestHandler'); > function add(){ > $this->layout = 'default'; > > if( $this->RequestHandler->isXML() ) > { > > configure::write('debug',0); > $users['firstname'] = 'firstname'; > $users['lastname'] = 'lastname'; > $this->set(compact('users')); > } > > } > > > layouts->xml->default.xml > <?php echo $this->Xml->header(array('version'=>'1.1')); > > layouts->users->xml add.xml > <?php echo $this->Xml->serialize($users); > > -- > 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 > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php