예제 #1
0
 /**
  * Builds all the XML information contained inside this node.
  *
  * @param DOMNode $node the parent node that will contain the XML
  *                      generated by this node.
  *
  * @return void
  */
 protected function _buildNode(DOMNode $node)
 {
     $document = $node->ownerDocument;
     foreach ($this->_authors as $author) {
         $node->appendChild($author->_getNode($node));
     }
     foreach ($this->_categories as $category) {
         $node->appendChild($category->_getNode($node));
     }
     if ($this->_content instanceof XML_Atom_Content) {
         $node->appendChild($this->_content->_getNode($node));
     }
     foreach ($this->_contributors as $contributor) {
         $node->appendChild($contributor->_getNode($node));
     }
     $id_text_node = $document->createTextNode($this->_id);
     $id_node = $document->createElementNS(XML_Atom_Node::NS, 'id');
     $id_node->appendChild($id_text_node);
     $node->appendChild($id_node);
     foreach ($this->_links as $link) {
         $node->appendChild($link->_getNode($node));
     }
     if ($this->_published instanceof XML_Atom_Published) {
         $node->appendChild($this->_published->_getNode($node));
     }
     if ($this->_rights != '') {
         $rights_text_node = $document->createTextNode($this->_rights);
         $rights_node = $document->createElementNS(XML_Atom_Node::NS, 'rights');
         $rights_node->appendChild($rights_text_node);
         $node->appendChild($rights_node);
     }
     if ($this->_source instanceof XML_Atom_Source) {
         $node->appendChild($this->_source->_getNode($node));
     }
     if ($this->_summary instanceof XML_Atom_Summary) {
         $node->appendChild($this->_summary->_getNode($node));
     }
     $node->appendChild($this->_title->_getNode($node));
     $node->appendChild($this->_updated->_getNode($node));
 }
예제 #2
0
파일: Feed.php 프로젝트: nburka/xml-atom
 /**
  * Builds all the XML information contained inside this node
  *
  * Adds each entry contained in this node to the parent node.
  *
  * @param DOMNode $node the parent node that will contain the XML generated
  *                      by this node.
  *
  * @return void
  */
 protected function _buildNode(DOMNode $node)
 {
     parent::_buildNode($node);
     foreach ($this->_entries as $entry) {
         $node->appendChild($entry->_getNode($node));
     }
 }