Browse Source

Added in very simple demonstration of XSL templating.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269194 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
f68102afa1
2 changed files with 32 additions and 0 deletions
  1. +13
    -0
      proposal/myrmidon/src/make/template-simple.ati
  2. +19
    -0
      proposal/myrmidon/src/make/template-simple.xsl

+ 13
- 0
proposal/myrmidon/src/make/template-simple.ati View File

@@ -0,0 +1,13 @@
<?xml version="1.0"?>

<project default="main" basedir=".">

<target name="main">
<echo message="Before template"/>
<echo-template msg="Template echo 1!" />
<echo-template msg="Template echo 2!" />
<echo-template msg="Template echo 3!" />
<echo message="After template"/>
</target>

</project>

+ 19
- 0
proposal/myrmidon/src/make/template-simple.xsl View File

@@ -0,0 +1,19 @@
<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="echo-template">
<echo message="This is an example of how to use a template to expand" />
<echo message="a single element into a list of tasks to do. In this" />
<echo message="example it is largely a case of echoing an attribute" />
<echo message="ie. msg='{@msg}'" />
</xsl:template>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Loading…
Cancel
Save