问题描述
我正在尝试使用此代码将新项目插入到 Xml 文件中
I'm trying to insert new item to Xml file with this code
$conn = sedna_connect($host,$database,$user,$password);
$path = dirname(__FILE__) . '/ADEDB.xml';
$file = file_get_contents($path);
sedna_load($file, 'ADEDB');
sedna_tweak_opt(SE_OPTID_AUTOCOMMIT, false);
sedna_transact_begin();
sedna_execute('
UPDATE insert
<Employee id="3">
<name>Louay Hamada</name>
<bday>21/01/1986</bday>
<reg>Homs</reg>
<adrs>Mazzeh</adrs>
</Employee>
into doc("ADEDB")/HRSystem/Employees
');
sedna_transact_commit();
sedna_tweak_opt(SE_OPTID_AUTOCOMMIT, true);
我知道我的代码会被磨损,但我没有找到任何文档或示例来帮助我解决这个问题:(
I know that my code would be worng, but I'm not found any document or examples that helps me to pass this problem :(
推荐答案
有 Sedna 事件日志(SEDNA_HOME/data/event*.log
文件).你检查过他们吗?有错误提示吗?
There are Sedna event logs (SEDNA_HOME/data/event*.log
files). Have you checked them? Is there any error message?
您是否尝试过通过 se_term
(Sedna 终端)运行相同的更新语句?还尝试运行 doc("ADEDB")/HRSystem/Employees
查询以查看它是否返回任何内容.
Have you tried to run the same update statement via se_term
(Sedna Terminal)? Try also to run doc("ADEDB")/HRSystem/Employees
query to see if it returns anything at all.
您的文档中有命名空间吗?
Do you have namespaces in your document?
这篇关于sedna 通过 PHP 更新插入到 Xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!