Czy ktos z was uzywa tej klasy http://www.webtweakers.com/phpdomxml/ ?
Mam sobie taki XML:
[xml:1:64bc8ec4a6]<?xml version="1.0" encoding="UTF-8"?>
<!-- Config for Carbon -->
<pages>
<page id="__common">
<template>common.tpl</template>
</page>
<page id="/">
<template>home.tpl</template>
<title>something</title>
<modules>
<module>news</module>
<module>search</module>
<module>polls</module>
</modules>
</page>
<!--
...
-->
</pages>[/xml:1:64bc8ec4a6]
I potrzebuje go zamienic na tablice czy tez obiekt.
Narazie robie to do tablicy (pozniej bedzie zapisana do pliku) w ten spsob:
[php:1:64bc8ec4a6]<?php
$xml = new XML( CONFIG_DIR."pages.conf.xml" );
$config = array();
$item = $xml->firstChild->firstChild;
while ( $item )
{
$config[$item->attributes['id']]['template'] = $item->firstChild->firstChild->nodeValue;
$item = $item->nextSibling;
}
?>[/php:1:64bc8ec4a6]
Z tym, ze problem mam z wydobyciem pozostalych elementow.
Niestety ten parser jest inny niz MSowy i nie wiem jak to ugryzc.
Jakies pomysly ?