Ciao,sto provano a leggere dei file di configurazione di dreamweaver, ma la loro composizione non č molto corretta a quanto ho capito avendo negli attributi caratteri non consentiti.
DW riesce a leggere e scrivere questi file e vorrei farlo anchio,ma fino adesso con i parser php ho fallito, voi cosa suggerite??
Essendo file del programma non possono quotare il codice negli attributi, altrimenti DW vā in palla.


Esempio:
test.ml
codice:
<menu>
    <item lingua="it">pippo</item>
    <item lingua="<div style='padding:10px;border:1px #000000 solid;'></div>">pippus</item>
</menu>
Codice PHP:

<?
#libxml_use_internal_errors(false);
if(file_exists('test.xml'))
    {
    
$xml simplexml_load_file('test.xml');
    
    echo 
"<pre>";
    
$a=0;
     foreach(
$xml->children() as $node)
        {
        echo 
"$node::";
        echo 
$xml->item[$a]->attributes()."
"
;
        echo 
$xml->item[$a]["lingua"]."
"
;
        
$a++;
        }
   
    
print_r($xml);
    echo 
"</pre>";
    }
    else
    {
    exit(
'Failed to open test.xml.');
    }
?>



errori che ricevo.....


Warning: simplexml_load_file() [function.simplexml-load-file]: test.xml:3: parser error : Unescaped '<' not allowed in attributes values in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: <item lingua="<div style='padding:10px;border:1px #000000 solid;'></div>">pippu in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: test.xml:3: parser error : attributes construct error in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: <item lingua="<div style='padding:10px;border:1px #000000 solid;'></div>">pippu in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: test.xml:3: parser error : Couldn't find end of Start Tag item line 3 in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: <item lingua="<div style='padding:10px;border:1px #000000 solid;'></div>">pippu in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: test.xml:3: parser error : Opening and ending tag mismatch: menu line 1 and item in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: lingua="<div style='padding:10px;border:1px #000000 solid;'></div>">pippus</item in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: test.xml:4: parser error : Extra content at the end of the document in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: </menu> in C:\Apache2.2\htdocs\test\index.php on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\Apache2.2\htdocs\test\index.php on line 5



Fatal error: Call to a member function children() on a non-object in C:\Apache2.2\htdocs\test\index.php on line 9