Class: Doc2Text::Docx::XmlNodes::Node

Inherits:
XmlBasedDocument::XmlNodes::Node show all
Defined in:
lib/doc2text/docx/docx_xml_namespaces.rb

Direct Known Subclasses

Generic, W::Wbody, W::Wbr, W::Wp

Instance Attribute Summary

Attributes inherited from XmlBasedDocument::XmlNodes::Node

#attrs, #children, #name, #parent, #prefix, #text

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from XmlBasedDocument::XmlNodes::Node

#close, #delete, #eql?, #expand, #generic?, #has_text?, inherited, #initialize, #open, #root?, #to_s, #xml_name

Constructor Details

This class inherits a constructor from Doc2Text::XmlBasedDocument::XmlNodes::Node

Class Method Details

.create_node(prefix, name, parent = nil, attrs = [], markdown_odt_parser = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/doc2text/docx/docx_xml_namespaces.rb', line 5

def self.create_node(prefix, name, parent = nil, attrs = [], markdown_odt_parser = nil)
  begin
    clazz = XmlNodes.const_get "#{prefix.capitalize}::W#{name}"
  rescue NameError => e
    # markdown_odt_parser.logger.warn "No such <#{prefix}:#{name}> found"
    Generic.new(parent, attrs, prefix, name, markdown_odt_parser)
  else
    clazz.new(parent, attrs, prefix, name, markdown_odt_parser)
  end
end

Instance Method Details

#body?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/doc2text/docx/docx_xml_namespaces.rb', line 16

def body?
  false
end