class OoxmlParser::DocxGraphic
Class for parsing `graphic` tags
Attributes
chart[RW]
data[RW]
type[RW]
Public Instance Methods
parse(node)
click to toggle source
Parse DocxGraphic
@param [Nokogiri::XML:Node] node with NumberingProperties
@return [DocxGraphic] result of parsing
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb, line 15 def parse(node) node.xpath('a:graphicData/*', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').each do |node_child| case node_child.name when 'wsp' @type = :shape @data = DocxShape.new(parent: self).parse(node_child) when 'pic' @type = :picture @data = DocxPicture.new(parent: self).parse(node_child) when 'chart' @type = :chart OOXMLDocumentObject.add_to_xmls_stack("#{OOXMLDocumentObject.root_subfolder}/#{OOXMLDocumentObject.get_link_from_rels(node_child.attribute('id').value)}") @data = Chart.new(parent: self).parse OOXMLDocumentObject.xmls_stack.pop when 'wgp' @type = :group @data = ShapesGrouping.new(parent: self).parse(node_child) end end self end