Class: Hpricot::XMLDecl

Inherits:
AttrNode show all
Includes:
Leaf, Trav
Defined in:
lib/hpricot/tag.rb,
lib/hpricot/nodes.rb,
lib/hpricot/modules.rb,
lib/hpricot/modules.rb

Defined Under Namespace

Modules: Trav

Constant Summary

Constants included from Hpricot

AttrCore, AttrEvents, AttrFocus, AttrHAlign, AttrI18n, AttrVAlign, Attrs, ElementContent, ElementExclusions, ElementInclusions, FORM_TAGS, NamedCharacters, NamedCharactersPattern, OmittedAttrName, SELF_CLOSING_TAGS

Instance Attribute Summary

Attributes inherited from AttrNode

#name, #parent, #raw_attributes

Instance Method Summary collapse

Methods included from Leaf::Trav

#traverse_all_element, #traverse_some_element, #traverse_text_internal

Methods included from Traverse

#after, #at, #before, #bogusetag?, #children_of_type, #clean_path, #comment?, #css_path, #doc?, #doctype?, #elem?, filter, #following, #get_subnode, #html, #index, #inner_html=, #inner_text, #make, #next, #node_position, #nodes_at, #position, #preceding, #previous, #procins?, #search, #swap, #text?, #to_html, #to_original_html, #to_plain_text, #traverse_element, #traverse_text, #xmldecl?, #xpath

Methods included from Leaf

#pretty_print

Methods included from Node

#altered!, #html_quote, #if_output, #inspect_tree

Methods included from Hpricot

build, scan, uxs, xchr, xs

Instance Method Details

#clear_raw ⇒ Object



101
102
103
# File 'lib/hpricot/nodes.rb', line 101

def clear_raw
  self.name = nil
end

#encoding ⇒ Object



106
# File 'lib/hpricot/nodes.rb', line 106

def encoding       = (raw_attributes || {})[:encoding]

#encoding=(v) ⇒ Object



113
114
115
# File 'lib/hpricot/nodes.rb', line 113

def encoding=(v)
  (self.raw_attributes ||= {})[:encoding] = v
end

#output(out, opts = {}) ⇒ Object



200
201
202
203
204
205
206
207
208
# File 'lib/hpricot/tag.rb', line 200

def output(out, opts = {})
  out <<
    if_output(opts) do
      "<?xml version=\"#{version}\"" +
        (encoding ? " encoding=\"#{encoding}\"" : "") +
        (standalone != nil ? " standalone=\"#{standalone ? 'yes' : 'no'}\"" : "") +
        "?>"
    end
end

#pathname ⇒ Object



199
# File 'lib/hpricot/tag.rb', line 199

def pathname; "xmldecl()" end

#standalone ⇒ Object



107
# File 'lib/hpricot/nodes.rb', line 107

def standalone     = (raw_attributes || {})[:standalone]

#standalone=(v) ⇒ Object



117
118
119
# File 'lib/hpricot/nodes.rb', line 117

def standalone=(v)
  (self.raw_attributes ||= {})[:standalone] = v
end

#version ⇒ Object



105
# File 'lib/hpricot/nodes.rb', line 105

def version        = (raw_attributes || {})[:version]

#version=(v) ⇒ Object



109
110
111
# File 'lib/hpricot/nodes.rb', line 109

def version=(v)
  (self.raw_attributes ||= {})[:version] = v
end