src/Lib/XmlTool.php
public static function getAttribute($node, $attribute_name, $default_value = null)
    {
        $value = $node->getAttribute($attribute_name);

        if (! isset($value) || strlen($value) == 0)
        {
            $value = $default_value;
        }

        return $value;
    }
public static function getAttribute($node, $attribute_name, $default_value = null)
    {
        $value = $node->getAttribute($attribute_name);

        if (! isset($value) || strlen($value) == 0)
        {
            $value = $default_value;
        }

        return $value;
    }
public static function getAttribute ( $ node , $ attribute_name , $ default_value = null ) { $ value = $ node -> getAttribute ( $ attribute_name ) ; if ( ! isset ( $ value ) || strlen ( $ value ) == 0 ) { $ value = $ default_value ; } return $ value ; }
Get an attribute value, or the default value if the attribute is null or empty

@param DOMNode $node The node to search the attribute on
@param string $attribute_name The name of the attribute to get the value from
@param string $default_value A default value if the attribute doesn't exist or is empty
Get an attribute value or the default value if the attribute is null or empty