/framework/core/xml/XmlDom.php
http://zoop.googlecode.com/ · PHP · 24 lines · 18 code · 2 blank · 4 comment · 0 complexity · 71ab6fd11519750d0181e222fcd78d49 MD5 · raw file
- <?
- class XmlDom
- {
- var $xmlTree;
-
- // returns the root node
- function parseText($xml)
- {
- $this->xmlTree = new DOMDocument();
- $this->xmlTree->loadXML($xml);
- return new XmlNode($this->xmlTree->firstChild);
- }
-
- function parseFile($fileName)
- {
- $this->xmlTree = new DOMDocument();
- // print_r($this->xmlTree);
- $this->xmlTree->load($fileName);
- // print_r($this->xmlTree->documentElement->firstChild->nextSibling->nodeName);
- // die('here');
- return new XmlNode($this->xmlTree->documentElement);
- }
- }
- ?>