XML Example Code to Parse:
<?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>
Testing XML String Parsing into Array
Array
(
[@attributes] => Array
(
)
[@children] => Array
(
[workspace] => Array
(
[0] => Array
(
[@attributes] => Array
(
[cmis:repositoryRelationship] => self
)
[@children] => Array
(
[collection] => Array
(
[0] => Array
(
[@attributes] => Array
(
[cmis:collectionType] => root-children
)
[@children] => Array
(
[atom:title] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
)
[@value] => root collection
)
)
)
)
[1] => Array
(
[@attributes] => Array
(
[cmis:collectionType] => root-descendants
)
[@children] => Array
(
[atom:title] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
)
[@value] => root collection
)
)
)
)
)
[cmis:repositoryInfo] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
[cmis:repositoryId] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
)
[@value] => 0f91f397-7cd1-479b-9f56-266affe188d8
)
)
[cmis:repositoryName] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
)
[@value] => Main Repository
)
)
[cmis:cmisVersionsSupported] => Array
(
[0] => Array
(
[@attributes] => Array
(
[cmis:normal] => bleg
)
[@children] => Array
(
[major] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
)
[@value] => 0
)
)
[minor] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
)
[@value] => 5
)
)
)
)
)
)
)
)
[atom:title] => Array
(
[0] => Array
(
[@attributes] => Array
(
)
[@children] => Array
(
)
[@value] => Main Repository
)
)
)
)
)
)
)
|