diff options
| -rw-r--r-- | make.xsl | 35 | ||||
| -rw-r--r-- | plan.xsl | 89 | ||||
| -rw-r--r-- | process.xsl (renamed from traverse.xsl) | 75 | ||||
| -rw-r--r-- | source/99_result/stream.xsl | 1 | 
4 files changed, 131 insertions, 69 deletions
| @@ -32,26 +32,31 @@  	<xsl:call-template name="generate">  		<xsl:with-param name="input"> -			<xsl:call-template name="merge_datasource"> -				<xsl:with-param name="main"> -					<xsl:call-template name="generate"> -						<xsl:with-param name="input"> -							<datasource> -								<xsl:value-of select="$source"/> -							</datasource> +			<xsl:call-template name="generate"> +				<xsl:with-param name="input"> +					<xsl:call-template name="merge_datasource"> +						<xsl:with-param name="main"> +							<xsl:call-template name="generate"> +								<xsl:with-param name="input"> +									<datasource> +										<xsl:value-of select="$source"/> +									</datasource> +								</xsl:with-param> +								<xsl:with-param name="transformation">list.xsl</xsl:with-param> +							</xsl:call-template> +						</xsl:with-param> +						<xsl:with-param name="support"> +							<meta> +								<source><xsl:value-of select="$source"/></source> +								<target><xsl:value-of select="$target"/></target> +							</meta>  						</xsl:with-param> -						<xsl:with-param name="transformation">list.xsl</xsl:with-param>  					</xsl:call-template>  				</xsl:with-param> -				<xsl:with-param name="support"> -					<meta> -						<source><xsl:value-of select="$source"/></source> -						<target><xsl:value-of select="$target"/></target> -					</meta> -				</xsl:with-param> +				<xsl:with-param name="transformation">plan.xsl</xsl:with-param>  			</xsl:call-template>  		</xsl:with-param> -		<xsl:with-param name="transformation">traverse.xsl</xsl:with-param> +		<xsl:with-param name="transformation">process.xsl</xsl:with-param>  	</xsl:call-template>  </xsl:template> diff --git a/plan.xsl b/plan.xsl new file mode 100644 index 0000000..6754d14 --- /dev/null +++ b/plan.xsl @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet +	version="1.0" +	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" +	xmlns:dyn="http://exslt.org/dynamic" +	xmlns:xalan="http://xml.apache.org/xalan" +	xmlns:InputXSLT="function.inputxslt.application" +	exclude-result-prefixes="dyn xalan InputXSLT" +> + +<xsl:output +	method="xml" +	omit-xml-declaration="yes" +	encoding="UTF-8" +	indent="yes" +/> + +<xsl:include href="utility/datasource.xsl"/> + +<xsl:template name="traverse"> +	<xsl:param name="source"/> +	<xsl:param name="target"/> +	<xsl:param name="path"/> +	<xsl:param name="node"/> + +	<xsl:for-each select="$node/directory"> +		<xsl:choose> +			<xsl:when test=".//file/@extension = '.xsl'"> +				<xsl:call-template name="traverse"> +					<xsl:with-param name="source" select="$source"/> +					<xsl:with-param name="target" select="$target"/> +					<xsl:with-param name="path"   select="concat($path, '/', @name)"/> +					<xsl:with-param name="node"   select="."/> +				</xsl:call-template> +			</xsl:when> +			<xsl:otherwise> +				<task type="link"> +					<from> +						<xsl:value-of select="concat($target, '/', $path, '/', @name)"/> +					</from> +					<to> +						<xsl:value-of select="concat($source, '/', $path, '/', @name)"/> +					</to> +				</task> +			</xsl:otherwise> +		</xsl:choose> +	</xsl:for-each> + +	<xsl:for-each select="$node/file"> +		<xsl:choose> +			<xsl:when test="@extension = '.xsl'"> +				<task type="generate"> +					<source> +						<xsl:value-of select="concat($source, '/', $path, '/', @name, @extension)"/> +					</source> +					<target> +						<xsl:value-of select="concat($target, '/', $path)"/> +					</target> +				</task> +			</xsl:when> +			<xsl:when test="@extension = '.css'"> +				<task type="link"> +					<from> +						<xsl:value-of select="concat($target, '/', $path, '/', @name, @extension)"/> +					</from> +					<to> +						<xsl:value-of select="concat($source, '/', $path, '/', @name, @extension)"/> +					</to> +				</task> +			</xsl:when> +		</xsl:choose> +	</xsl:for-each> +</xsl:template> + +<xsl:template match="datasource"> +	<task type="clean"> +		<path> +			<xsl:value-of select="meta/target"/> +		</path> +	</task> + +	<xsl:call-template name="traverse"> +		<xsl:with-param name="source" select="$root/meta/source"/> +		<xsl:with-param name="target" select="$root/meta/target"/> +		<xsl:with-param name="node"   select="source"/> +	</xsl:call-template> +</xsl:template> + +</xsl:stylesheet> diff --git a/traverse.xsl b/process.xsl index 6814312..d8f2aab 100644 --- a/traverse.xsl +++ b/process.xsl @@ -8,8 +8,6 @@  	exclude-result-prefixes="dyn xalan InputXSLT"  > -<xsl:import href="utility/helper.xsl"/> -  <xsl:output  	method="xml"  	omit-xml-declaration="yes" @@ -17,7 +15,7 @@  	indent="yes"  /> -<xsl:variable name="root" select="/datasource"/> +<xsl:include href="utility/helper.xsl"/>  <xsl:template name="generate">  	<xsl:param name="input"/> @@ -35,8 +33,8 @@  	<xsl:param name="from"/>  	<xsl:param name="to"/> -	<linkage from="{$from}" to="{$to}" result="{InputXSLT:external-command( -		concat('ln -sr ', $to, ' ', $from) +	<linkage from="./{$from}" to="./{$to}" result="{InputXSLT:external-command( +		concat('ln -sr ./', $to, ' ./', $from)  	)/self::command/@result}"/>  </xsl:template> @@ -159,59 +157,30 @@  	</xsl:choose>  </xsl:template> -<xsl:template name="traverse"> -	<xsl:param name="source"/> -	<xsl:param name="target"/> -	<xsl:param name="path"/> -	<xsl:param name="node"/> - -	<xsl:for-each select="$node/directory"> -		<xsl:choose> -			<xsl:when test=".//file/@extension = '.xsl'"> -				<xsl:call-template name="traverse"> -					<xsl:with-param name="source" select="$source"/> -					<xsl:with-param name="target" select="$target"/> -					<xsl:with-param name="path"   select="concat($path, '/', @name)"/> -					<xsl:with-param name="node"   select="."/> -				</xsl:call-template> -			</xsl:when> -			<xsl:otherwise> -				<xsl:call-template name="linker"> -					<xsl:with-param name="from" select="concat($target, '/', $path, '/', @name)"/> -					<xsl:with-param name="to"   select="concat($source, '/', $path, '/', @name)"/> -				</xsl:call-template> -			</xsl:otherwise> -		</xsl:choose> -	</xsl:for-each> - -	<xsl:for-each select="$node/file"> -		<xsl:choose> -			<xsl:when test="@extension = '.xsl'"> -				<xsl:call-template name="process"> -					<xsl:with-param name="source" select="concat($source, '/', $path, '/', @name, @extension)"/> -					<xsl:with-param name="target" select="concat($target, '/', $path)"/> -				</xsl:call-template> -			</xsl:when> -			<xsl:when test="@extension = '.css'"> -				<xsl:call-template name="linker"> -					<xsl:with-param name="from" select="concat($target, '/', $path, '/', @name, @extension)"/> -					<xsl:with-param name="to"   select="concat($source, '/', $path, '/', @name, @extension)"/> -				</xsl:call-template> -			</xsl:when> -		</xsl:choose> -	</xsl:for-each> +<xsl:template match="task[@type = 'clean']"> +	<xsl:call-template name="cleaner"> +		<xsl:with-param name="path" select="path"/> +	</xsl:call-template>  </xsl:template> -<xsl:template match="datasource"> -	<xsl:call-template name="cleaner"> -		<xsl:with-param name="path" select="meta/target"/> +<xsl:template match="task[@type = 'generate']"> +	<xsl:call-template name="process"> +		<xsl:with-param name="source" select="source"/> +		<xsl:with-param name="target" select="target"/>  	</xsl:call-template> +</xsl:template> -	<xsl:call-template name="traverse"> -		<xsl:with-param name="source" select="$root/meta/source"/> -		<xsl:with-param name="target" select="$root/meta/target"/> -		<xsl:with-param name="node"   select="source"/> +<xsl:template match="task[@type = 'link']"> +	<xsl:call-template name="linker"> +		<xsl:with-param name="from" select="from"/> +		<xsl:with-param name="to"   select="to"/>  	</xsl:call-template>  </xsl:template> +<xsl:template match="datasource"> +	<xsl:apply-templates select="task[@type = 'clean']"/> +	<xsl:apply-templates select="task[@type = 'generate']"/> +	<xsl:apply-templates select="task[@type = 'link']"/> +</xsl:template> +  </xsl:stylesheet> diff --git a/source/99_result/stream.xsl b/source/99_result/stream.xsl index 355314c..526b8db 100644 --- a/source/99_result/stream.xsl +++ b/source/99_result/stream.xsl @@ -47,7 +47,6 @@  			<a href="{$url}/tag/{.}">  				<xsl:value-of select="."/>  			</a> -			<xsl:text> </xsl:text>  		</xsl:for-each>  		<xsl:text> | Adrian Kummerländer</xsl:text>  	</p> | 
