Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Rather than trying to build something in Java why not generate your ANTForm configuration file using XLST, based on the XML output produced by the standard subversion client:</p> <pre><code>svn list --xml http://svn.apache.org/repos/asf/ant/ivy/core/tags &gt; releases.xml </code></pre> <p>Produces the following <em>releases.xml</em> file (I've edited it for clarity):</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;lists&gt; &lt;list path="http://svn.apache.org/repos/asf/ant/ivy/core/tags"&gt; &lt;entry ..&gt; &lt;name&gt;1.4.1&lt;/name&gt; .. &lt;/entry&gt; &lt;entry ..&gt; &lt;name&gt;2.0.0&lt;/name&gt; .. &lt;/entry&gt; &lt;/list&gt; &lt;/lists&gt; </code></pre> <h2>Example</h2> <p>Example is comprised of two files</p> <ul> <li>genGUI.xml </li> <li>genGUI.xsl</li> </ul> <p>Run as follows:</p> <pre><code>ant -f genGUI.xml </code></pre> <p><strong>genGUI.xml</strong></p> <pre><code>&lt;project name="genGUI" default="run"&gt; &lt;property name="repo.url" value="http://svn.apache.org/repos/asf/ant/ivy/core/tags"/&gt; &lt;property name="build.dir" location="build"/&gt; &lt;property name="xsl.file" location="genGUI.xsl"/&gt; &lt;property name="data.file" location="${build.dir}/data.xml"/&gt; &lt;property name="run.file" location="${build.dir}/run.xml"/&gt; &lt;target name="init"&gt; &lt;mkdir dir="${build.dir}"/&gt; &lt;/target&gt; &lt;target name="get-data" depends="init"&gt; &lt;exec executable="svn" failonerror="true" output="${data.file}"&gt; &lt;arg line="list --xml ${repo.url}"/&gt; &lt;/exec&gt; &lt;/target&gt; &lt;target name="generate" depends="get-data"&gt; &lt;xslt style="${xsl.file}" in="${data.file}" out="${run.file}"/&gt; &lt;/target&gt; &lt;target name="run" depends="generate"&gt; &lt;ant antfile="${run.file}"/&gt; &lt;/target&gt; &lt;target name="clean"&gt; &lt;delete dir="${build.dir}"/&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p><strong>genGUI.xsl</strong></p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="xml" indent="yes"/&gt; &lt;xsl:variable name="antform-home"&gt;${env.ANTFORM_HOME}&lt;/xsl:variable&gt; &lt;xsl:template match="/"&gt; &lt;project name="genForm" default="menu"&gt; &lt;property environment="env"/&gt; &lt;path id="runtime.cp"&gt; &lt;pathelement location="{$antform-home}/lib/antform.jar"/&gt; &lt;/path&gt; &lt;target name="menu"&gt; &lt;taskdef name="antmenu" classname="com.sardak.antform.AntMenu" classpathref="runtime.cp"/&gt; &lt;antmenu image="{$antform-home}/doc/images/logo-small.jpg" title="My simple form" stylesheet="{$antform-home}/style.test"&gt; &lt;label&gt;Form is generated from subversion&lt;/label&gt; &lt;xsl:apply-templates select="lists/list/entry"/&gt; &lt;/antmenu&gt; &lt;/target&gt; &lt;/project&gt; &lt;/xsl:template&gt; &lt;xsl:template match="entry"&gt; &lt;button label="{name}" target="{name}"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload