Class | LibXML::XML::Node |
In: |
lib/libxml/node.rb
lib/libxml/properties.rb |
Parent: | Object |
first | -> | child |
each | -> | each_child |
Returns a new XML::XPathContext for the current node.
Namespaces is an optional array of XML::NS objects
——- Traversal —————- Iterates over this node‘s attributes.
doc = XML::Document.new('model/books.xml') doc.root.each_attr {|attr| puts attr}
Iterates over this node‘s child elements (nodes that have a node_type == ELEMENT_NODE).
doc = XML::Document.new('model/books.xml') doc.root.each_element {|element| puts element}
Return nodes matching the specified xpath expression. For more information, please refer to the documentation for XML::Document#find.
Namespaces is an optional array of XML::NS objects
Return the first node matching the specified xpath expression. For more information, please refer to the documentation for the find method.
Converts a node‘s children, to a string representation. To include the node, use XML::Node#to_s. For more information about the supported options, see XML::Node#to_s.
Returns this node‘s XML::Namespaces object, which is used to access the namespaces associated with this node.