static public Method

Node.new(node=nil)

Create a new element.

Source Code

# File rexml/light/node.rb, line 21
def initialize node=nil
        @node = node
        if node.kind_of? String
                node = [ :text, node ]
        elsif node.nil?
                node = [ :document, nil, nil ]
        elsif node[0] == :start_element
                node[0] = :element
        elsif node[0] == :start_doctype
                node[0] = :doctype
        elsif node[0] == :start_document
                node[0] = :document
        end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.