南强小屋 Design By 杰米
使用方法如下,可以看到miniXML的使用,与ActiveLink-PHP-XML-Package-0.4.0相比,更加符合使用习惯,也更加的简单.
$xmlDoc = new MiniXMLDoc();
$xmlRoot =& $xmlDoc->getRoot();
$childElement =& $xmlRoot->createChild(\'achild\');
$childElement->attribute(\'name\', \'annie\');
$childElement->text(\'This element has attributes and children, such as this\');
$image =& $childElement->createChild(\'image\');
$image->attribute(\'location\', \'http://psychogenic.com/image.png\');
$childElement->text(\'image and little\');
$orphan =& $xmlDoc->createElement(\'song\');
$orphan->text(\'tomorrow, tomorrow\');
$childElement->appendChild($orphan);
print $xmlDoc->toString();
添加一个子元素,有两种方式,第一种是直接该结点createChild,第二种是先xmlDoc先createElement,然后,该结点在appendChild.
最后打印出来的结果是:
<?xml version="1.0"?>
<achild name="annie" eyes="#0000FF" hair="#FF0000">
This element has attributes and children, such as this
<image location="http://psychogenic.com/image.png" />
image and little
<song> tomorrow, tomorrow </song>
</achild>
可以很明显的看得出,miniXML的使用方法是非常简单的,尤其是对于简单的保存数据的XML文件,更是如此,详细可以看miniXML提供的例子.此处不详说.
=========================================================================
解析
minixml文件结构是:
minixml.inc.php
------classes
-----------doc.inc.php element.inc.php node.inc.php treecomp.inc.php
详细的API解释说明,在官方网站上有介绍: http://minixml.psychogenic.com/api.html.
$xmlDoc = new MiniXMLDoc();
$xmlRoot =& $xmlDoc->getRoot();
$childElement =& $xmlRoot->createChild(\'achild\');
$childElement->attribute(\'name\', \'annie\');
$childElement->text(\'This element has attributes and children, such as this\');
$image =& $childElement->createChild(\'image\');
$image->attribute(\'location\', \'http://psychogenic.com/image.png\');
$childElement->text(\'image and little\');
$orphan =& $xmlDoc->createElement(\'song\');
$orphan->text(\'tomorrow, tomorrow\');
$childElement->appendChild($orphan);
print $xmlDoc->toString();
添加一个子元素,有两种方式,第一种是直接该结点createChild,第二种是先xmlDoc先createElement,然后,该结点在appendChild.
最后打印出来的结果是:
<?xml version="1.0"?>
<achild name="annie" eyes="#0000FF" hair="#FF0000">
This element has attributes and children, such as this
<image location="http://psychogenic.com/image.png" />
image and little
<song> tomorrow, tomorrow </song>
</achild>
可以很明显的看得出,miniXML的使用方法是非常简单的,尤其是对于简单的保存数据的XML文件,更是如此,详细可以看miniXML提供的例子.此处不详说.
=========================================================================
解析
minixml文件结构是:
minixml.inc.php
------classes
-----------doc.inc.php element.inc.php node.inc.php treecomp.inc.php
详细的API解释说明,在官方网站上有介绍: http://minixml.psychogenic.com/api.html.
标签:
php,minixml,详解
南强小屋 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
南强小屋 Design By 杰米
暂无php minixml详解的评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?