Class LibXML::XML::Node
In: lib/libxml/node.rb
lib/libxml/properties.rb
Parent: Object

Methods

External Aliases

first -> child
each -> each_child

Public Instance methods

Specifies if this is an attribute node

Specifies if this is an attribute declaration node

Determines whether this node has attributes

Specifies if this is an CDATA node

child?()

Alias for first?

Returns this node‘s children as an array.

children?()

Alias for first?

Create a shallow copy of the node. To create a deep copy call Node#copy(true)

Specifies if this is an comment node

Returns a new XML::XPathContext for the current node.

Namespaces is an optional array of XML::NS objects

Specifies if this is an docbook node

Specifies if this is an docbook node

Specifies if this is an DOCTYPE node

Specifies if this is an DTD node

Create a shallow copy of the node. To create a deep copy call Node#copy(true)

——- 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}

Specifies if this is an element node

Specifies if this is an element declaration node

Specifies if this is an entity node

Specifies if this is an entity reference node

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.

Determines whether this node has a first node

Specifies if this is a fragment node

Specifies if this is a html document node

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.

Determines whether this node has a last node

Specifies if this is a namespace node (not if it has a namepsace)

Returns this node‘s XML::Namespaces object, which is used to access the namespaces associated with this node.

Determines whether this node has a next node

Returns this node‘s type name

Specifies if this is a notation node

Determines whether this node has a parent node

Specifies if this is a processiong instruction node

Determines whether this node has a previous node

Specifies if this is a text node

Specifies if this is an xinclude end node

Specifies if this is an xinclude start node

[Validate]