|
@@ -35,7 +35,7 @@ abstract class Xml extends File
|
|
* As we are supporting namespaces the only way to get to the attributes under a node is to use attributes function on it
|
|
* As we are supporting namespaces the only way to get to the attributes under a node is to use attributes function on it
|
|
*
|
|
*
|
|
* @param SimpleXMLElement $node
|
|
* @param SimpleXMLElement $node
|
|
- * @param $attributeName
|
|
|
|
|
|
+ * @param string $attributeName
|
|
* @return string
|
|
* @return string
|
|
*/
|
|
*/
|
|
protected function _getAttribute(SimpleXmlElement $node, $attributeName)
|
|
protected function _getAttribute(SimpleXmlElement $node, $attributeName)
|
|
@@ -45,12 +45,25 @@ abstract class Xml extends File
|
|
return (string)$attributes[$attributeName];
|
|
return (string)$attributes[$attributeName];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Get boolean attribute value.
|
|
|
|
+ * As we are supporting namespaces the only way to get to the attributes under a node is to use attributes function on it
|
|
|
|
+ *
|
|
|
|
+ * @param SimpleXMLElement $node
|
|
|
|
+ * @param string $attributeName
|
|
|
|
+ * @return boolean
|
|
|
|
+ */
|
|
|
|
+ protected function _getBooleanAttribute(SimpleXmlElement $node, $attributeName)
|
|
|
|
+ {
|
|
|
|
+ return 'true' === strtolower($this->_getAttribute($node, $attributeName));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* does attribute exist under a specific node
|
|
* does attribute exist under a specific node
|
|
* As we are supporting namespaces the only way to get to the attributes under a node is to use attributes function on it
|
|
* As we are supporting namespaces the only way to get to the attributes under a node is to use attributes function on it
|
|
*
|
|
*
|
|
* @param SimpleXMLElement $node
|
|
* @param SimpleXMLElement $node
|
|
- * @param $attributeName
|
|
|
|
|
|
+ * @param string $attributeName
|
|
* @return string
|
|
* @return string
|
|
*/
|
|
*/
|
|
protected function _isAttributeSet(SimpleXmlElement $node, $attributeName)
|
|
protected function _isAttributeSet(SimpleXmlElement $node, $attributeName)
|
|
@@ -82,4 +95,4 @@ abstract class Xml extends File
|
|
}
|
|
}
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|