| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
- xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
- xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
- xmlns:d2a="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita-to-ant/d2a.xsd"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
- xmlns:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
- xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"
- exclude-result-prefixes="xs d2a"
- version="2.0">
-
-
- <xsl:include href="d2a.new_ant_project.child.task.bash.xsl"/>
-
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
- <xsl:template match="steps" mode="d2a:new_ant_project.child.task">
- <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
- <xsl:apply-templates mode="#current">
- <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
-
- <xsl:function name="d2a:p5ant.executable"><!-- detect executable -->
- <xsl:param name="p5dkp:ditafiles.xml"/>
- <xsl:param name="ditaarch:apiname"/>
- <xsl:choose>
- <xsl:when test="$ditaarch:apiname/@keyref">${<xsl:value-of select="$ditaarch:apiname/@keyref"/>}</xsl:when><!-- <xsl:copy-of select="d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,$ditaarch:apiname/@keyref)" copy-namespaces="no"/> -->
- <xsl:when test="$ditaarch:apiname/text()"><xsl:value-of select="$ditaarch:apiname/text()"/></xsl:when>
- <xsl:otherwise><xsl:message terminate="yes">#36 ditaarch:apiname not contains @keyref nor text() - we do not know what to execute </xsl:message></xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="d2a:p5ant.executable.dir"><!-- detect dir -->
- <xsl:param name="p5dkp:ditafiles.xml"/>
- <xsl:param name="ditaarch:step"/>
- <xsl:message>#45-A d2a:p5ant.executable.dir name()/<xsl:value-of select="$ditaarch:step/name()"/> cmd $ditaarch:step/stepresult/filepath/text() = <xsl:value-of select="$ditaarch:step/step/stepresult/filepath/text()"/> </xsl:message>
- <xsl:choose>
- <xsl:when test="$ditaarch:step/step/cmd/apiname and $ditaarch:step/step/stepresult/filepath/text()">
- <xsl:message>#45 d2a:p5ant.executable.dir cmd localtext </xsl:message>
- <xsl:copy-of select="$ditaarch:step/step/stepresult/filepath/text()" copy-namespaces="no"/></xsl:when>
- <xsl:when test="$ditaarch:step/step/cmd/apiname and $ditaarch:step/step/stepresult/@keyref"><xsl:copy-of select="d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,$ditaarch:step/step/stepresult/@keyref)" copy-namespaces="no"/></xsl:when>
- <xsl:otherwise><xsl:copy-of select="d2a:ditamap.INPUT.basedir.xmlatt.ref('dir')" copy-namespaces="no"/></xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
- <xsl:template match="step" mode="d2a:new_ant_project.child.task">
- <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
- <xsl:variable name="d2a:p5ant.executable.dir.priority" select="d2a:p5ant.executable.dir($p5dkp:ditafiles.xml,current())"/>
- <target name="default"> <!-- step_{generate-id()} -->
- <xsl:choose>
- <xsl:when test="cmd/apiname/@keyref='platform.shell.bash.platform_no'">
- <xsl:message>#26 todo detect method by relations analysys</xsl:message>
- <xsl:apply-templates mode="d2a:new_ant_project.child.task.bash">
- <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
- <xsl:with-param name="d2a:p5ant.executable.dir.priority" select="$d2a:p5ant.executable.dir.priority"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="contains(d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,cmd/apiname/@keyref),'shell.bash.dita')">
- <xsl:message>#26-A todo detect method by relations analysys</xsl:message>
- <xsl:apply-templates mode="d2a:new_ant_project.child.task.bash">
- <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
- <xsl:with-param name="d2a:p5ant.executable.dir.priority" select="$d2a:p5ant.executable.dir.priority"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="cmd/apiname">
- <xsl:message>#26-B todo using exec associated key reference cmd/apiname = <xsl:value-of select="cmd/apiname/@keyref"/> = forcing then = <xsl:value-of select="d2a:p5ant.executable($p5dkp:ditafiles.xml,cmd/apiname)"/></xsl:message>
- <xsl:apply-templates mode="d2a:new_ant_project.child.task.bash">
- <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
- <xsl:with-param name="d2a:p5ant.executable.priority" select="d2a:p5ant.executable($p5dkp:ditafiles.xml,cmd/apiname)"/>
- <xsl:with-param name="d2a:p5ant.executable.dir.priority" select="$d2a:p5ant.executable.dir.priority"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">#38 UNSUPPORTED cmd/apiname/@keyref='<xsl:value-of select="cmd/apiname/@keyref"/>'.
- Now working @keyref=platform.shell.bash.platform_no
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- <!--<DEBUG29>
- <xsl:apply-templates mode="#current">
- <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
- </xsl:apply-templates>
- </DEBUG29>-->
- </target>
- </xsl:template>
-
- <xsl:template match="cmd" mode="d2a:new_ant_project.child.task_XXXX">
- <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
- <xsl:comment>#34 cmd</xsl:comment>
- <xsl:apply-templates mode="#current">
- <xsl:with-param name="p5dkp:ditafiles.xml" select="$p5dkp:ditafiles.xml"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="apiname[@keyref]" mode="d2a:new_ant_project.child.task_XXXX">
- <xsl:param name="p5dkp:ditafiles.xml" required="yes"/>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <resolve_keyref><xsl:copy-of select="d2a:keyref($p5dkp:ditafiles.xml/ancestor-or-self::*/descendant-or-self::*,@keyref)"/>
- <test>
- <xsl:for-each select="$p5dkp:ditafiles.xml/ancestor-or-self::*">
- <ancestor name="{name()}">
- <xsl:for-each select="descendant-or-self::*">
- <descdend name="{name()}">
- <xsl:choose>
- <xsl:when test="map.keys.eval[keys[@map.keys.eval='platform.shell.bash.platform_no']]">
- <HURRA></HURRA>
- </xsl:when>
- </xsl:choose>
- </descdend>
- </xsl:for-each>
- </ancestor>
- </xsl:for-each>
- </test>
- </resolve_keyref>
- </xsl:copy>
- </xsl:template>
-
-
-
-
- </xsl:stylesheet>
|