コード例 #1
0
ファイル: XmlUtil.php プロジェクト: byjg/xmlutil
 /**
  * Remove a node specified by your tag name. You must pass a \DOMDocument ($node->ownerDocument);
  *
  * @param \DOMDocument $domdocument
  * @param string $tagname
  * @return bool
  */
 public static function removeTagName(\DOMDocument $domdocument, $tagname)
 {
     $nodeLista = $domdocument->getElementsByTagName($tagname);
     if ($nodeLista->length > 0) {
         $node = $nodeLista->item(0);
         XmlUtil::removeNode($node);
         return true;
     } else {
         return false;
     }
 }