~fabiocbalbuquerque/sahana-agasti/web-services

« back to all changes in this revision

Viewing changes to apps/frontend/lib/packages/agWebservicesPackage/modules/agWebservices/templates/getSuccess.xml.php

  • Committer: Fabio Albuquerque
  • Date: 2011-08-22 21:48:05 UTC
  • Revision ID: fabiocbalbuquerque@gmail.com-20110822214805-pryls2h7aqihomg8
Little correction at XML parser

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
foreach ($results as $k => $entity) {
5
5
    $xml .= '<entity type="'.$type.'">';
6
6
    foreach ($entity as $key => $value) {
7
 
        $xml .= '<'.$key.'>'.dump($value).'</'.$key.'>';
 
7
        $xml .= '<'.(is_numeric($key)?'element id="'.$key.'"':$key).'>'.dump($value).'</'.(is_numeric($key)?'element':$key).'>';
8
8
    }
9
9
    $xml .= '</entity>';
10
10
}