class GraphViz::XML

Attributes

graph[RW]

The GraphViz object

Public Class Methods

new( xml_file, *options ) click to toggle source

Create a graph from a XML file

In:

  • xml_file : XML File

  • *options : Graph options:

    • :text : show text nodes (default true)

    • :attrs : show XML attributes (default true)

# File lib/graphviz/xml.rb, line 47
def initialize( xml_file, *options )
  @node_name = "00000"
       @show_text = true
       @show_attributes = true

  if options and options[0]
    options[0].each do |xKey, xValue|
      case xKey.to_s
        when "text"
          @show_text = xValue
                      options[0].delete( xKey )
        when "attrs"
          @show_attributes = xValue
                      options[0].delete( xKey )
      end
    end
  end

  @rexml_document = REXML::Document::new( File::new( xml_file ) )
  @graph = GraphViz::new( "XML", *options )
  parse_xml_node( @rexml_document.root() )
end

Public Instance Methods

output( *options ) click to toggle source

Generate the graph

THIS METHOD IS DEPRECATED, PLEASE USE #graph.output

# File lib/graphviz/xml.rb, line 31
def output( *options )
  warn "GraphViz::XML.output is deprecated, use GraphViz::XML.graph.output"
  @graph.output( *options )
end