Parent

Methods

GraphViz::XML

Public Class Methods

new( xFile, *hOpt ) click to toggle source

Create a graph from a XML file

In:

  • xFile : XML File

  • *hOpt : Graph options

# File lib/graphviz/xml.rb, line 59
def initialize( xFile, *hOpt )
  @xNodeName = "00000"
        @bShowText = true
        @bShowAttrs = true

  if hOpt.nil? == false and hOpt[0].nil? == false
    hOpt[0].each do |xKey, xValue|
      case xKey.to_s
        when "text"
          @bShowText = xValue
                      hOpt[0].delete( xKey )
        when "attrs"
          @bShowAttrs = xValue
                      hOpt[0].delete( xKey )
      end
    end
  end

  @oReXML = REXML::Document::new( File::new( xFile ) )
  @oGraph = GraphViz::new( "XML", *hOpt ) 
  _init( @oReXML.root() )
end

Public Instance Methods

output( *hOpt ) click to toggle source

Generate the graph

Options :

  • :output : Output format (Constants::FORMATS)

  • :file : Output file name

  • :use : Program to use (Constants::PROGRAMS)

  • :path : Program PATH

  • :<format> => <file> : <file> can be

    • a file name

    • nil, then the output will be printed to STDOUT

    • String, then the output will be returned as a String

  • :errors : DOT error level (default 1)

    • 0 = Error + Warning

    • 1 = Error

    • 2 = none

# File lib/graphviz/xml.rb, line 46
def output( *hOpt )
  @oGraph.output( *hOpt )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.