sedna 通过 PHP 更新插入到 Xml [英] Update insert to Xml by sedna via PHP

查看:24
本文介绍了sedna 通过 PHP 更新插入到 Xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此代码将新项目插入到 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆