| Class | HTree::Elem |
| In: |
htree/modules.rb
htree/elem.rb |
| Parent: | Object |
The first argument name should be an instance of String or HTree::Name.
The rest of arguments should be a sequence of follows.
HTree::Location object is accepted just as HTree::Node.
If the rest arguments consists only Hash and HTree::Context, empty element is created.
p HTree::Elem.new("e").empty_element? # => true
p HTree::Elem.new("e", []).empty_element? # => false
The argument pairs should be a hash or an assocs.
The key of pairs should be one of following.
The value of pairs should be one of follows.
e = HTree('<r><a/><b/><c/></r>').root
p e.subst_subnode({0=>HTree('<x/>'), 2=>HTree('<z/>')})
p e.subst_subnode([[0, HTree('<x/>')], [2,HTree('<z/>')]])
# =>
{elem <r> {emptyelem <x>} {emptyelem <b>} {emptyelem <z>}}
{elem <r> {emptyelem <x>} {emptyelem <b>} {emptyelem <z>}}