如何渲染DotML [英] How to render DotML

查看:126
本文介绍了如何渲染DotML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将DotML渲染为图表?根据这里的网站:

How do I render DotML into a chart? According to the website here:


从您的数据获取图形是一个三步过程。首先,生成或手动键入包含DotML元素的> XHTML(或任何其他XML)文件。

Getting graphs from your data is a three-step process. First, generate or manually type a >XHTML (or any other XML) file that contains DotML elements.

使用 http://www.martin-loetzsch.de/DOTML 作为DotML元素的命名空间标识符。 >如果要验证您的DotML元素,请使用DotML模式。

Use "http://www.martin-loetzsch.de/DOTML" as the namespace identifier for DotML elements. >If you want to validate your DotML elements, use the DotML Schema.

其次,在输入文件上应用脚本generate-svg-graphics.bash。它应用> dotml2dot.xsl样式表,并为每个DotML图形元素生成SVG图表和包含大小> SVG图表的CSS文件。请查看generate-svg-> graphics.bash所需的环境变量和参数。

Second, apply the script "generate-svg-graphics.bash" on the input file. It applies the >dotml2dot.xsl stylesheet and generates a SVG chart and a CSS file containing the size of >the SVG chart for each DotML graph element. Please have a look into "generate-svg->graphics.bash" for required environment variables and parameters.

第三,如果DotML图表嵌入到XHTML文档中, XSLT样式表embed-> svg-graphics.xsl通过包含生成的> SVG来替换DotML图元素。请查看embed-svg-graphics.xsl了解详情。

Third, if the DotML graph is embedded into an XHTML document, the XSLT stylesheet "embed->svg-graphics.xsl" replaces the DotML graph elements by the inclusion of the generated >SVGs. Please look into "embed-svg-graphics.xsl" for details.

我已经输入了XML,但我不知道剩下的步骤是什么意思。

I have the typed XML already, but I do not know what the rest of the steps mean. If anyone could explain how to do this at a very simple level that would be fantastic.

推荐答案

DotML是一种基于XML的替代解决方案用于驱动GraphViz程序的点语言的语法。使用它的正常方式是将DotML转换为点,然后运行GraphViz生成SVG。我这样做(从Ant)在这里:

DotML is an alternative XML-based syntax for the dot language used to drive the GraphViz program. The normal way of using it is to convert the DotML to dot, and then run GraphViz to generate SVG. The way I do it (from Ant) is here:

  <target name="dot-files" depends="merge-catalog" if="build.spec" unless="spec.exists">
    <xslt in="${merged-spec.xml}" out="${dist.dir}/Overview.html" style="style/xslt-diff.xsl" 
      force="yes" classpathref="saxon9.classpath">
      <factory name="net.sf.saxon.TransformerFactoryImpl">
        <attribute name="http://saxon.sf.net/feature/initialMode" value="make-dot-files"/>
      </factory>
      <param name="baseline" expression="${baseline}"/>
      <param name="show.diff.markup.string" expression="0"/>
    </xslt>    
  </target>

  <target name="diagrams" description="Process all the diagrams in the img directory"
    depends="dot-files">
    <foreach target="diagram" param="diagram">
      <path>
        <fileset dir="${dist.dir}/img">
          <include name="*.dot"/>
        </fileset>
      </path>
    </foreach>
  </target>

  <target name="diagram">
    <echo message="Converting diagram ${diagram}"/>
    <basename property="name" file="${diagram}" suffix=".dot"/>
    <echo message="  to ${dist.dir}/img/${name}.svg"/>
    <!-- Requires "dot" to be on the path. dot is part of GraphViz. Location might be GraphViz2.24/bin/dot-->
    <exec executable="dot">
      <arg line="-o${dist.dir}/img/${name}.raw.svg -Tsvg ${diagram} "/>
    </exec>

    <xslt in="${dist.dir}/img/${name}.raw.svg" out="${dist.dir}/img/${name}.svg" style="style/tidy-graphviz-svg.xsl" 
      force="yes" classpathref="saxon9.classpath"/>   
  </target>

我的case有点不同,因为我开始一个文档包含多个图在一个XML首先需要转换为DotML的词汇。

My case is a bit different because I'm starting with a document that contains multiple diagrams in an XML vocabulary that first needs to be transformed to DotML.

这篇关于如何渲染DotML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆