This question was cross-posted on https://biostar.usegalaxy.org/p/7619/ "Adding custom tools: resolving (external ) XML entities" I'd like to replace fragments of XML code in my custom tool declaration. My first idea was to use XML entities but it seems that the XML engine doesn't resolve them. (BTW: I know I can replace/declare things in $PATH and tool_dependencies.xml ) Another idea was to use <macros><token...> but I cannot make it work (see https://gist.github.com/lindenb/b2a04e0fefd4d295dba9 ) my macros definition: <?xml version="1.0"?> <macros> <token name="@JAVA_EXE@">/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java</token> <token name="@JVM_OPTIONS@">-Xmx500m</token> </macros> my tool definition: as a test, I echoed the value of @JAVA_EXE@ in /tmp/galaxy.txt (the macro was *not replaced* ) <?xml version="1.0" encoding="UTF-8"?> <tool id="com_github_lindenb_jvarkit_tools_misc_VcfHead" name="VcfHead" version="e098748b85acd5158a1ce612bd3d46e60948b9db" hidden="false"> <description>Print the first lines of a VCF</description> <macros> <import>jvarkit_macros.xml</import> </macros> <command>echo "@JAVA_EXE@" > /tmp/galaxy.txt && zcat -f ${input} | @JAVA_EXE@ @JVM_OPTIONS@ -cp /commun/data/packages/htsjdk/dist/apache-ant-1.8.2-bzip2.jar:/commun/data/packages/htsjdk/dist/htsjdk-1.112.jar:/commun/data/packages/htsjdk/dist/commons-jexl-2.1.1.jar:/commun/data/packages/htsjdk/dist/commons-logging-1.1.1.jar:/commun/data/packages/jvarkit-git/vcfhead.jar com.github.lindenb.jvarkit.tools.misc.VcfHead -n ${number} 2> /dev/null > ${output}</command> <inputs> <param format="vcf" name="input" type="data" label="Source VCF" optional="false"/> <param name="number" type="integer" value="10" label="Number of rows" optional="true"/> </inputs> <outputs> <data format="input" name="output" metadata_source="input"/> </outputs> <help>see https://github.com/lindenb/jvarkit/wiki/VcfHead</help> </tool> the output of 'hg tip' changeset: 9312:788cd3d06541 tag: tip parent: 9310:19f6e62bd372 parent: 9311:d7f37a2fe690 user: Nate Coraor <nate@bx.psu.edu> date: Mon Apr 08 12:30:08 2013 -0400 summary: Merged stable. what's wrong in my <macros> definition ? Thanks. Pierre