Location: PHPKode > scripts > XMLns2array > xmlns2array/test.php
<?php

include_once('XMLns2array.inc.php');


$xml='<?xml version="1.0" encoding="utf-8"?>
<service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05" xmlns:alf="http://www.alfresco.org">
  <workspace cmis:repositoryRelationship="self">
    <atom:title>Main Repository</atom:title>
    <cmis:repositoryInfo>
      <cmis:repositoryId>0f91f397-7cd1-479b-9f56-266affe188d8</cmis:repositoryId>
      <cmis:repositoryName>Main Repository</cmis:repositoryName>
      <cmis:cmisVersionsSupported cmis:normal="bleg">
      	<major>0</major>
      	<minor>5</minor>
      </cmis:cmisVersionsSupported>
    </cmis:repositoryInfo>
    <collection href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore/Company%20Home/children" cmis:collectionType="root-children">
      <atom:title>root collection</atom:title>
    </collection>
    <collection href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore/Company%20Home/descendants" cmis:collectionType="root-descendants">
      <atom:title>root collection</atom:title>
    </collection>
  </workspace>
</service>
';


echo '<b>XML Example Code to Parse:</b><pre>'.htmlentities($xml).'</pre>';
echo '<hr /><b>Testing XML String Parsing into Array</b><pre>'.print_r(XMLns2array::parse($xml),true).'</pre>';
echo '<hr /><b>Testing SimpleXMLElement Parsing into Array</b><pre>'.print_r(XMLns2array::parse(simplexml_load_string($xml)),true).'</pre>';

?>
Return current item: XMLns2array