Method: OpenNebula::XMLElement#has_elements?
- Defined in:
- lib/opennebula/xml_element.rb
#has_elements?(xpath_str) ⇒ Boolean
Returns wheter there are elements for a given XPath
- xpath_str
-
String XPath expression to locate the element
262 263 264 265 266 267 268 269 270 |
# File 'lib/opennebula/xml_element.rb', line 262 def has_elements?(xpath_str) if NOKOGIRI element = @xml.xpath(xpath_str.to_s.upcase) return element != nil && element.children.size > 0 else element = @xml.elements[xpath_str.to_s] return element != nil && element.has_elements? end end |