示例#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));
     }
     foreach ($this->_contributors as $contributor) {
         $node->appendChild($contributor->_getNode($node));
     }
     if ($this->_generator instanceof XML_Atom_Generator) {
         $node->appendChild($this->_generator->_getNode($node));
     }
     if ($this->_icon != '') {
         $icon_text_node = $document->createTextNode($this->_icon);
         $icon_node = $document->createElementNS(XML_Atom_Node::NS, 'icon');
         $icon_node->appendChild($icon_text_node);
         $node->appendChild($icon_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->_logo != '') {
         $logo_text_node = $document->createTextNode($this->_logo);
         $logo_node = $document->createElementNS(XML_Atom_Node::NS, 'logo');
         $logo_node->appendChild($logo_text_node);
         $node->appendChild($logo_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->_subtitle instanceof XML_Atom_Subtitle) {
         $node->appendChild($this->_subtitle->_getNode($node));
     }
     $node->appendChild($this->_title->_getNode($node));
     $node->appendChild($this->_updated->_getNode($node));
 }
示例#2
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));
 }