hp mini110 php minixml详解

WBOY
发布: 2016-07-29 08:38:25
原创
979 人浏览过

使用方法如下,可以看到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. 
最后打印出来的结果是: 
 
 
This element has attributes and children, such as this 
 
image and little 
 tomorrow, tomorrow  
 
可以很明显的看得出,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.

以上就介绍了hp mini110 php minixml详解,包括了hp mini110方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!