/**
  * Get the value of attribute
  *
  * @param DOMNode $node       Node
  * @param string  $attName    Attribute name
  * @param string  $purgeChars The input string
  * @param boolean $addslashes Escape slashes is the return string
  *
  * @return string
  */
 function getValueAttributNode(DOMNode $node, $attName, $purgeChars = "", $addslashes = false)
 {
     $text = null;
     if ($att = $node->getAttributeNode($attName)) {
         $text = $this->convertEncoding($att->value);
         $text = str_replace(str_split($purgeChars), "", $text);
         $text = trim($text);
         if ($addslashes) {
             $text = addslashes($text);
         }
     }
     return $text;
 }