<?xml version="1.0"?>
<?xml-stylesheet 
 href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/7793/bug">
    <title>PEAR Bug #7793</title>
    <link>http://pear.php.net/bugs/7793</link>
    <description>[Closed] XML container not working</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7793"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7793/2006-06-02+08%3A45%3A16#2006-06-02+08%3A45%3A16"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7793/2006-06-02+08%3A08%3A57#2006-06-02+08%3A08%3A57"/>
     </rdf:Seq>
    </items>
  </channel>
    <item rdf:about="http://pear.php.net/bugs/7793">
      <title>dan.b@... [2006-06-02 07:04:39]</title>
      <link>http://pear.php.net/bugs/7793</link>
      <description><![CDATA[<pre>Translation2 Bug
Reported by dan.b@...
2006-06-02T11:04:39-00:00
PHP: 4.3.9 OS: Linux 2.6.14-1.1653_FC4sm Package Version: 2.0.0beta9

Description:
------------
This might not be a bug. I might be using this all wrong, but, I'm trying to use XML as the data source for this and it wont seem to create an initial XML file.

Now, I'm guessing that the reason it says that it can't read from the file is that the file doesn't exist, but how does one actually create the XML file to start with? I would have thought that this factory method would have created a blank XML file as and when required?

Or am I missing something really simple here?

Test script:
---------------
&lt;?php

$driver = 'XML';
$options = array(
        'filename' =&gt;           '/tmp/i18n.xml',
        'save_on_shutdown' =&gt;   true
);

require_once 'Translation2.php';
$tr =&amp; Translation2::factory($driver, $options);
if (PEAR::isError($tr)) {
        print &quot;MESSAGE: &quot; . $tr-&gt;getMessage() . &quot;\n&quot;;
        var_dump($tr);
        exit();
}
else {
        print &quot;That worked fine!\n&quot;;
}

?&gt;

Expected result:
----------------
That worked fine!

Actual result:
--------------
MESSAGE: Can\'t read from the XML source: /home/dburzynski/i18n.xml
object(pear_error)(8) {
  [&quot;error_message_prefix&quot;]=&gt;
  string(0) &quot;&quot;
  [&quot;mode&quot;]=&gt;
  int(1)
  [&quot;level&quot;]=&gt;
  int(1024)
  [&quot;code&quot;]=&gt;
  NULL
  [&quot;message&quot;]=&gt;
  string(58) &quot;Can\'t read from the XML source: /home/dburzynski/i18n.xml&quot;
  [&quot;userinfo&quot;]=&gt;
  NULL
  [&quot;backtrace&quot;]=&gt;
  array(5) {
    [0]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(49) &quot;/usr/local/lib/php/Translation2/Container/xml.php&quot;
      [&quot;line&quot;]=&gt;
      int(159)
      [&quot;function&quot;]=&gt;
      string(10) &quot;pear_error&quot;
      [&quot;class&quot;]=&gt;
      string(10) &quot;pear_error&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;-&gt;&quot;
      [&quot;args&quot;]=&gt;
      array(1) {
        [0]=&gt;
        string(58) &quot;Can\'t read from the XML source: /home/dburzynski/i18n.xml&quot;
      }
    }
    [1]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(49) &quot;/usr/local/lib/php/Translation2/Container/xml.php&quot;
      [&quot;line&quot;]=&gt;
      int(138)
      [&quot;function&quot;]=&gt;
      string(9) &quot;_loadfile&quot;
      [&quot;class&quot;]=&gt;
      string(26) &quot;translation2_container_xml&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;-&gt;&quot;
      [&quot;args&quot;]=&gt;
      array(0) {
      }
    }
    [2]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(35) &quot;/usr/local/lib/php/Translation2.php&quot;
      [&quot;line&quot;]=&gt;
      int(180)
      [&quot;function&quot;]=&gt;
      string(4) &quot;init&quot;
      [&quot;class&quot;]=&gt;
      string(26) &quot;translation2_container_xml&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;-&gt;&quot;
      [&quot;args&quot;]=&gt;
      array(1) {
        [0]=&gt;
        array(2) {
          [&quot;filename&quot;]=&gt;
          string(25) &quot;/home/dburzynski/i18n.xml&quot;
          [&quot;save_on_shutdown&quot;]=&gt;
          bool(true)
        }
      }
    }
    [3]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(35) &quot;/usr/local/lib/php/Translation2.php&quot;
      [&quot;line&quot;]=&gt;
      int(152)
      [&quot;function&quot;]=&gt;
      string(15) &quot;_storagefactory&quot;
      [&quot;class&quot;]=&gt;
      string(12) &quot;translation2&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;::&quot;
      [&quot;args&quot;]=&gt;
      array(2) {
        [0]=&gt;
        string(3) &quot;XML&quot;
        [1]=&gt;
        array(2) {
          [&quot;filename&quot;]=&gt;
          string(25) &quot;/home/dburzynski/i18n.xml&quot;
          [&quot;save_on_shutdown&quot;]=&gt;
          bool(true)
        }
      }
    }
    [4]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(33) &quot;/home/dburzynski/src/transmin.php&quot;
      [&quot;line&quot;]=&gt;
      int(10)
      [&quot;function&quot;]=&gt;
      string(7) &quot;factory&quot;
      [&quot;class&quot;]=&gt;
      string(12) &quot;translation2&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;::&quot;
      [&quot;args&quot;]=&gt;
      array(2) {
        [0]=&gt;
        string(3) &quot;XML&quot;
        [1]=&gt;
        array(2) {
          [&quot;filename&quot;]=&gt;
          string(25) &quot;/home/dburzynski/i18n.xml&quot;
          [&quot;save_on_shutdown&quot;]=&gt;
          bool(true)
        }
      }
    }
  }
  [&quot;callback&quot;]=&gt;
  NULL
}</pre>]]></description>
      <content:encoded><![CDATA[<pre>Translation2 Bug
Reported by dan.b@...
2006-06-02T11:04:39-00:00
PHP: 4.3.9 OS: Linux 2.6.14-1.1653_FC4sm Package Version: 2.0.0beta9

Description:
------------
This might not be a bug. I might be using this all wrong, but, I'm trying to use XML as the data source for this and it wont seem to create an initial XML file.

Now, I'm guessing that the reason it says that it can't read from the file is that the file doesn't exist, but how does one actually create the XML file to start with? I would have thought that this factory method would have created a blank XML file as and when required?

Or am I missing something really simple here?

Test script:
---------------
&lt;?php

$driver = 'XML';
$options = array(
        'filename' =&gt;           '/tmp/i18n.xml',
        'save_on_shutdown' =&gt;   true
);

require_once 'Translation2.php';
$tr =&amp; Translation2::factory($driver, $options);
if (PEAR::isError($tr)) {
        print &quot;MESSAGE: &quot; . $tr-&gt;getMessage() . &quot;\n&quot;;
        var_dump($tr);
        exit();
}
else {
        print &quot;That worked fine!\n&quot;;
}

?&gt;

Expected result:
----------------
That worked fine!

Actual result:
--------------
MESSAGE: Can\'t read from the XML source: /home/dburzynski/i18n.xml
object(pear_error)(8) {
  [&quot;error_message_prefix&quot;]=&gt;
  string(0) &quot;&quot;
  [&quot;mode&quot;]=&gt;
  int(1)
  [&quot;level&quot;]=&gt;
  int(1024)
  [&quot;code&quot;]=&gt;
  NULL
  [&quot;message&quot;]=&gt;
  string(58) &quot;Can\'t read from the XML source: /home/dburzynski/i18n.xml&quot;
  [&quot;userinfo&quot;]=&gt;
  NULL
  [&quot;backtrace&quot;]=&gt;
  array(5) {
    [0]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(49) &quot;/usr/local/lib/php/Translation2/Container/xml.php&quot;
      [&quot;line&quot;]=&gt;
      int(159)
      [&quot;function&quot;]=&gt;
      string(10) &quot;pear_error&quot;
      [&quot;class&quot;]=&gt;
      string(10) &quot;pear_error&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;-&gt;&quot;
      [&quot;args&quot;]=&gt;
      array(1) {
        [0]=&gt;
        string(58) &quot;Can\'t read from the XML source: /home/dburzynski/i18n.xml&quot;
      }
    }
    [1]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(49) &quot;/usr/local/lib/php/Translation2/Container/xml.php&quot;
      [&quot;line&quot;]=&gt;
      int(138)
      [&quot;function&quot;]=&gt;
      string(9) &quot;_loadfile&quot;
      [&quot;class&quot;]=&gt;
      string(26) &quot;translation2_container_xml&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;-&gt;&quot;
      [&quot;args&quot;]=&gt;
      array(0) {
      }
    }
    [2]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(35) &quot;/usr/local/lib/php/Translation2.php&quot;
      [&quot;line&quot;]=&gt;
      int(180)
      [&quot;function&quot;]=&gt;
      string(4) &quot;init&quot;
      [&quot;class&quot;]=&gt;
      string(26) &quot;translation2_container_xml&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;-&gt;&quot;
      [&quot;args&quot;]=&gt;
      array(1) {
        [0]=&gt;
        array(2) {
          [&quot;filename&quot;]=&gt;
          string(25) &quot;/home/dburzynski/i18n.xml&quot;
          [&quot;save_on_shutdown&quot;]=&gt;
          bool(true)
        }
      }
    }
    [3]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(35) &quot;/usr/local/lib/php/Translation2.php&quot;
      [&quot;line&quot;]=&gt;
      int(152)
      [&quot;function&quot;]=&gt;
      string(15) &quot;_storagefactory&quot;
      [&quot;class&quot;]=&gt;
      string(12) &quot;translation2&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;::&quot;
      [&quot;args&quot;]=&gt;
      array(2) {
        [0]=&gt;
        string(3) &quot;XML&quot;
        [1]=&gt;
        array(2) {
          [&quot;filename&quot;]=&gt;
          string(25) &quot;/home/dburzynski/i18n.xml&quot;
          [&quot;save_on_shutdown&quot;]=&gt;
          bool(true)
        }
      }
    }
    [4]=&gt;
    array(6) {
      [&quot;file&quot;]=&gt;
      string(33) &quot;/home/dburzynski/src/transmin.php&quot;
      [&quot;line&quot;]=&gt;
      int(10)
      [&quot;function&quot;]=&gt;
      string(7) &quot;factory&quot;
      [&quot;class&quot;]=&gt;
      string(12) &quot;translation2&quot;
      [&quot;type&quot;]=&gt;
      string(2) &quot;::&quot;
      [&quot;args&quot;]=&gt;
      array(2) {
        [0]=&gt;
        string(3) &quot;XML&quot;
        [1]=&gt;
        array(2) {
          [&quot;filename&quot;]=&gt;
          string(25) &quot;/home/dburzynski/i18n.xml&quot;
          [&quot;save_on_shutdown&quot;]=&gt;
          bool(true)
        }
      }
    }
  }
  [&quot;callback&quot;]=&gt;
  NULL
}</pre>]]></content:encoded>
      <dc:date>2006-06-02T11:04:39-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7793/2006-06-02+08%3A45%3A16#2006-06-02+08%3A45%3A16">
      <title>dan.b@... [2006-06-02 12:45]</title>
      <link>http://pear.php.net/bugs/7793#1149252316</link>
      <description><![CDATA[<pre>Cool. Works fine. :-D</pre>]]></description>
      <content:encoded><![CDATA[<pre>Cool. Works fine. :-D</pre>]]></content:encoded>
      <dc:date>2006-06-02T12:45:16-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7793/2006-06-02+08%3A08%3A57#2006-06-02+08%3A08%3A57">
      <title>quipo [2006-06-02 12:08]</title>
      <link>http://pear.php.net/bugs/7793#1149250137</link>
      <description><![CDATA[<pre>there's a sample xml file in the testsuite. Anyway, I've added a check in CVS, please test the new file. You should be able to work with an empty xml file (but it must exist).
To add languages and strings you have to use the Admin class.</pre>]]></description>
      <content:encoded><![CDATA[<pre>there's a sample xml file in the testsuite. Anyway, I've added a check in CVS, please test the new file. You should be able to work with an empty xml file (but it must exist).
To add languages and strings you have to use the Admin class.</pre>]]></content:encoded>
      <dc:date>2006-06-02T12:08:57-00:00</dc:date>
    </item>
</rdf:RDF>