
Artem - 2007-05-29 05:05:34
Hello! It seems that to post messages in this forum is wrong way to decide your question, becaus anyone have answered previuos person :). But i decided to try :).
So. DOMIT is the real good thing for working with xml as DOM. But i have some trubles with it.
Well i have XML file like this:
<articals>
<artical xml:id="2">
<title>Some title</title>
<anounce>Some anounce</anounce>
<file>./some/file.path</file>
</artical>
<articals>
So i have problem to open file after getting string from <file> node content.
...
//..getting <file> node as $fileNode
...
$filename = $fileNode->firstChild->toString();
$fp = fopen( $filename, 'w' ); // and in this code warrning appears "can not open stream" $filename have wrong string format, i think.
What will i have to do to get right string with filename?
I`m thinking about such way as to save file path as attribute of <file>, but it`s not very good for my xml.
Thanks.