示例#1
0
文件: draw.py 项目: nekanek/xsl-graph
def render_templates_tree(xsl):
    graph = create_graph()

    logging.debug('TRYING TO RENDER')

    gv.layout(graph, 'dot')

    tree = get_applies_tree(xsl)

    draw_tree(tree, graph, [])
    gv.layout(graph, 'dot')

    data = gv.renderdata(graph, 'svg')

    logging.debug('RENDERED!!!')

    return data
示例#2
0
文件: draw.py 项目: sintell/xsl-graph
def render_templates_tree(xsl):
    graph = create_graph()

    logging.debug('TRYING TO RENDER')

    gv.layout(graph, 'dot')

    tree = get_applies_tree(xsl)

    draw_tree(tree, graph, [])
    gv.layout(graph, 'dot')

    data = gv.renderdata(graph, 'svg')

    logging.debug('RENDERED!!!')

    return data
示例#3
0
文件: run.py 项目: sintell/xsl-graph
#
#        if template.name is not None:
#            name_templates[template.name].append(template)
#
#
#    links = []
#
#    for name, templates in called_templates.iteritems():
#        if len(name_templates[name]) > 1:
#            sorted_templates = sorted(name_templates[name],
#                                      reverse=True,
#                                      cmp=lambda x,y: compare_import_priorities(x.i_priority, y.i_priority))
#            links.append((sorted_templates[0], templates))
#
#    print links

    from pyproc import analyze
    from lxml import etree

    stylesheet = Stylesheet(xsl)

    a = get_applies_tree(xsl)
    print a
    s


    with open('test.svg', 'w') as f:
        f.write(get_applies_tree(xsl))

#    print etree.tostring(analyze.get_full_xml(xsl), pretty_print=True)
示例#4
0
文件: run.py 项目: nekanek/xsl-graph
    #                called_templates[template_name].append(item)
    #
    #        if template.name is not None:
    #            name_templates[template.name].append(template)
    #
    #
    #    links = []
    #
    #    for name, templates in called_templates.iteritems():
    #        if len(name_templates[name]) > 1:
    #            sorted_templates = sorted(name_templates[name],
    #                                      reverse=True,
    #                                      cmp=lambda x,y: compare_import_priorities(x.i_priority, y.i_priority))
    #            links.append((sorted_templates[0], templates))
    #
    #    print links

    from pyproc import analyze
    from lxml import etree

    stylesheet = Stylesheet(xsl)

    a = get_applies_tree(xsl)
    print a
    s

    with open("test.svg", "w") as f:
        f.write(get_applies_tree(xsl))

#    print etree.tostring(analyze.get_full_xml(xsl), pretty_print=True)