Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8598407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:08:37+00:00 2026-06-12T01:08:37+00:00

My XML View files contain (for exporting records via XML): <records><?php echo $this->Xml->serialize($records); ?></records>

  • 0

My XML View files contain (for exporting records via XML):

 <records><?php echo $this->Xml->serialize($records); ?></records>

After upgrading to 2.0 I realized there is no Xml helper anymore.
But the Xml class itself doesnt seem to provide an equally powerful method anymore, either.
It only contains sth like

$Xml = Xml::fromArray($records, array('format' => 'attribute'));
...
<records><?php echo $Xml->asXML(); ?></records>

But that – of course – fails because it can only transform “one record at a time”.
It also fails if I force it into a single parent key like

$records = array('records'=>$records);

first…

No clue how to get the XML export stuff working, again.
especially, as it seems, the expected input for the 2.0 XML class (http://book.cakephp.org/2.0/en/core-utility-libraries/xml.html#Xml) is quite different from what the model returns (and would probably have to be transformed somehow).
Old structure (and like the model respectably):

$records = array(
    array('Project'=>array('field'=>'value', ...)),
    array('Project'=>array('field'=>'value', ...)),
);

New structure

$records = array(
    'projects' => array(
        'project' => array(
            array(
                'id' => 1, 'title' => 'Project 1',
                'industry' => array('id' => 1, 'name' => Industry 1')
            ),
            array(
                'id' => 2, 'title' => 'Project 2',
                'industry' => array('id' => 2, 'name' => Industry 2')
            )
        )
    )
);

Totally incompatible to what the model gives us, or so it seems.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:08:38+00:00Added an answer on June 12, 2026 at 1:08 am

    the answer to it is pretty simply I found out shortly after asking the question via http://cakephp.lighthouseapp.com/projects/42648/tickets/2789-xml-view-defect

    basically, you always need a single parent. so the old syntax could be seen as invalid. therefore upgrading and moving to the outlined new structure seems to be a requirement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why do Android xml layout files need android: before every single view attribute? Doesn't
I have created XML file,but I can't view it/output it.I know there is no
Having this XML view: <?xml version=1.0 encoding=utf-8?> <LinearLayout android:id=@+id/myScrollLayout android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical xmlns:android=http://schemas.android.com/apk/res/android> <ScrollView
When using the Event Viewer in Windows 7, there is a separate 'XML View'
Could someone tell me how to view the XML to be sent via web
There are two different xml files in layout and layout-land for the respective modes.
Can a XML file be generated for an iPhone view? The view may contain
I am using image view and gallery in my xml file. i am getting
I want to call my XML layout file in a class that extends view.
I have an XML view in a rails app, and need to insert in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.