Module XTemplate::XNodeManager
In: lib/xtemplate/xml.rb

Methods

Constants

NEWLINE = $/

Attributes

root  [R] 

Public Instance methods

[Source]

# File lib/xtemplate/xml.rb, line 24
    def init_root()
      @root  = XNode.new(nil)
    end

[Source]

# File lib/xtemplate/xml.rb, line 46
    def pop_node
      @root = @root.parent
    end

[Source]

# File lib/xtemplate/xml.rb, line 34
    def push_attr(attr)
      @root.add_attr(attr)
    end

[Source]

# File lib/xtemplate/xml.rb, line 38
    def push_attrval(val)
      @root.add_attrval(SanitizedString[val])
    end

[Source]

# File lib/xtemplate/xml.rb, line 42
    def push_content(*str)
      @root.add_child(SanitizedString[*str])
    end

[Source]

# File lib/xtemplate/xml.rb, line 50
    def push_optname(str)
      @root.add_optname(str)
    end

[Source]

# File lib/xtemplate/xml.rb, line 54
    def push_optval(val)
      @root.add_optval(SanitizedString[val])
    end

[Source]

# File lib/xtemplate/xml.rb, line 58
    def push_pi(target, pi)
      case target.downcase
      when "xtemplate"
        push_tag(nil)
        @root.pi = pi
        pop_node()
      else
        if( pi && pi.strip != "" )
          push_content("<?#{target} #{pi}?>")
        else
          push_content("<?#{target}?>")
        end
      end
    end

[Source]

# File lib/xtemplate/xml.rb, line 28
    def push_tag(tag)
      node = XNode.new(SanitizedString.new(tag))
      @root.add_child(node)
      @root = node
    end

[Source]

# File lib/xtemplate/xml.rb, line 73
    def to_s
      @root.to_s
    end

[Validate]