Class HTree::Doc
In: htree/modules.rb
htree/doc.rb
Parent: Object

Methods

Included Modules

Container Trav

Classes and Modules

Module HTree::Doc::Trav
Class HTree::Doc::Loc

Public Class methods

The arguments should be a sequence of follows.

String object
specified string is converted to HTree::Text.
HTree::Node object
used as a child.
HTree::Doc object
used as children. It is expanded except HTree::XMLDecl and HTree::DocType objects.
Array of String, HTree::Node and HTree::Doc
used as children.

Public Instance methods

  doc.subst_subnode(pairs) -> doc

The argument pairs should be a hash or an assocs. Its key should be an integer which means an index for children.

Its value should be one of follows.

HTree::Node object
specified object is used as is.
String object
specified string is converted to HTree::Text
Array of above
specified HTree::Node and String is used in that order.
nil
delete corresponding node.
  d = HTree('<a/><b/><c/>')
  p d.subst_subnode({0=>HTree('<x/>'), 2=>HTree('<z/>')})
  p d.subst_subnode([[0,HTree('<x/>')], [2,HTree('<z/>')]])
  # =>
  #<HTree::Doc {emptyelem <x>} {emptyelem <b>} {emptyelem <z>}>
  #<HTree::Doc {emptyelem <x>} {emptyelem <b>} {emptyelem <z>}>

Protected Instance methods

[Validate]