最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

php minixml詳解

 更新時間:2008年07月19日 19:49:23   作者:  
MiniXML來自 Sourceforge ,參見:http://sourceforge.net/projects/minixml/,也有自己的官方網(wǎng)站: http://minixml.psychogenic.com/index.html.
使用方法如下,可以看到miniXML的使用,與ActiveLink-PHP-XML-Package-0.4.0相比,更加符合使用習(xí)慣,也更加的簡單. 

$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(); 

添加一個子元素,有兩種方式,第一種是直接該結(jié)點(diǎn)createChild,第二種是先xmlDoc先createElement,然后,該結(jié)點(diǎn)在appendChild. 

最后打印出來的結(jié)果是: 
<?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的使用方法是非常簡單的,尤其是對于簡單的保存數(shù)據(jù)的XML文件,更是如此,詳細(xì)可以看miniXML提供的例子.此處不詳說. 

========================================================================= 

解析 

minixml文件結(jié)構(gòu)是: 
minixml.inc.php 
------classes 
-----------doc.inc.php element.inc.php node.inc.php treecomp.inc.php 

詳細(xì)的API解釋說明,在官方網(wǎng)站上有介紹: http://minixml.psychogenic.com/api.html.

相關(guān)文章

最新評論

福海县| 固安县| 天津市| 清丰县| 陇西县| 南投市| 格尔木市| 四川省| 突泉县| 金华市| 潜山县| 丹阳市| 富阳市| 陕西省| 武强县| 祁阳县| 石林| 靖边县| 光泽县| 云浮市| 虎林市| 沾益县| 嘉定区| 普宁市| 天峻县| 图片| 满城县| 仲巴县| 达日县| 马公市| 会同县| 涿州市| 黄龙县| 安多县| 镇宁| 县级市| 咸丰县| 冕宁县| 穆棱市| 揭东县| 青浦区|