DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> XML學習教程 >> XML詳解 >> 使用PHP 5.0 輕松解析XML文檔(3)
使用PHP 5.0 輕松解析XML文檔(3)
編輯:XML詳解     
pleDocumentRoot.PHP

  
  文件:SimpleDocumentNode.PHP

<?PHP/** *========================================================= * * @author hahawen(大齡青年) * @since 2004-12-04 * @copyright Copyright (c) 2004, NxCoder Group * *========================================================= *//** * class SimpleDocumentNode * xml Node class, include values/attributes/subnodes. * all this pachage@#s is work for xml file, and method is action as DOM. * * @package SmartWeb.common.XML * @version 1.0 */class SimpleDocumentNode extends SimpleDocumentBase{ private $seq = null; private $rootObject = null; private $pNodeId = null; function __construct($rootObject, $pNodeId, $nodeTag, $seq) { parent::__construct($nodeTag); $this->rootObject = $rootObject; $this->pNodeId = $pNodeId; $this->seq = $seq; } public function getPNodeObject() { return ($this->pNodeId==-1)? $this->rootObject: $this->rootObject->getNodeById($this->pNodeId); } public function getSeq(){ return $this->seq; } public function createNode($name, $attributes) { return $this->createNodeByName($this->rootObject, $name, $attributes, $this->getSeq()); } public function removeNode($name) { return $this->removeNodeByName($this->rootObject, $name); } public function getNode($name=null) { return $this->getNodeByName($this->rootObject, $name); }}?>

  • 上一篇文章: XML-Schema的DTD描述 - ASP.Net
  • 下一篇文章: XML+ JS創建樹形菜單
  • XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
    Copyright © DIV+CSS佈局教程網 All Rights Reserved