| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- exclude-result-prefixes="xs"
- xmlns:graph="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/graph/graph.xsd"
- xmlns:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
- version="2.0">
-
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
- <!--<xsl:include href="graph.graph-to-analyze-evaluated.func.xsl"/>-->
-
- <xsl:param name="graph.graph-to-analyze-property.xml" required="yes"/>
-
- <xsl:variable name="graph:graph.graph-to-analyze-property.xml" select="doc($graph.graph-to-analyze-property.xml)"/>
- <xsl:template match="graph:graph.graph-to-analyze.xml" mode="graph:graph-to-analyze-evaluated.xml">
- <graph:graph-to-analyze-evaluated.xml>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="#current"/>
- </graph:graph-to-analyze-evaluated.xml>
- </xsl:template>
-
- <xsl:template match="*" mode="graph:graph-to-analyze-evaluated.xml">
- <xsl:copy copy-namespaces="no">
- <xsl:apply-templates mode="graph:graph-to-analyze-evaluated.xml" select="@*"/>
- <xsl:apply-templates mode="#current"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="@*" mode="graph:graph-to-analyze-evaluated.xml">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template match="@value[ contains(.,'${')]|@location[ contains(.,'${')]" mode="graph:graph-to-analyze-evaluated.xml">
- <xsl:attribute name="{name()}" select="$graph:graph.graph-to-analyze-property.xml//property[@name = current()/../@name][1]/@graph:property.evaluated"/>
- <xsl:attribute name="graph:value-evaluated-from" select="."/>
- </xsl:template>
- <!--
- <xsl:template match="@destdir[ contains(.,'${') and ancestor-or-self::target]" mode="graph:graph-to-analyze-evaluated.xml">
- <!-\-<xsl:attribute name="{name()}" select="$graph:graph.graph-to-analyze-property.xml//property[@name = graph:graph-to-analyze-evaluated.property(current())][1]/@graph:property.evaluated"/>-\->
- <xsl:attribute name="{name()}" select="graph:graph-to-analyze-evaluated.property(.)"/>
- <xsl:attribute name="graph:value-evaluated-from" select="."/>
- </xsl:template>
-
- <xsl:template match="@file[ contains(.,'${') and ancestor-or-self::target]" mode="graph:graph-to-analyze-evaluated.xml">
- <!-\-<xsl:attribute name="{name()}" select="$graph:graph.graph-to-analyze-property.xml//property[@name = graph:graph-to-analyze-evaluated.property(current())][1]/@graph:property.evaluated"/>-\->
- <xsl:attribute name="{name()}" select="graph:graph-to-analyze-evaluated.property(.)"/>
- <xsl:attribute name="graph:value-evaluated-from" select="."/>
- </xsl:template>
-
- <xsl:template match="@tofile[ contains(.,'${') and ancestor-or-self::target]" mode="graph:graph-to-analyze-evaluated.xml">
- <!-\-<xsl:attribute name="{name()}" select="$graph:graph.graph-to-analyze-property.xml//property[@name = graph:graph-to-analyze-evaluated.property(current())][1]/@graph:property.evaluated"/>-\->
- <xsl:attribute name="{name()}" select="graph:graph-to-analyze-evaluated.property(.)"/>
- <xsl:attribute name="graph:value-evaluated-from" select="."/>
- </xsl:template>-->
-
- <xsl:function name="graph:graph-to-analyze-evaluated.property">
- <xsl:param name="graph:property.eval"/>
- <!--<graph:graph-to-analyze-evaluated.property>-->
- <xsl:copy-of select="graph:graph-to-analyze-evaluated.property($graph:property.eval,1)"></xsl:copy-of>
- <!--</graph:graph-to-analyze-evaluated.property>-->
- </xsl:function>
-
- <xsl:function name="graph:graph-to-analyze-evaluated.property">
- <xsl:param name="graph:property.eval" />
- <xsl:param name="graph:property.evaluated.recurse_level"/>
- <xsl:message>
- #51 called for $property.eval = <xsl:value-of select="$graph:property.eval"/></xsl:message>
- <xsl:choose>
- <xsl:when test="$graph:property.evaluated.recurse_level > 8">
- <xsl:message>#38 ERROR RECURSE $graph:property.evaluated.recurse_level=<xsl:value-of select="$graph:property.evaluated.recurse_level"/></xsl:message>
- <xsl:attribute name="graph:property.evaluated.recurse_level" select="$graph:property.evaluated.recurse_level"/>
- </xsl:when>
- <xsl:when test=" contains($graph:property.eval,'\$') or 1=1">
- <xsl:variable name="tokens">
- <tokens>
- <!--<xsl:attribute name="graph:property.eval.esc" select="$graph:property.eval.esc"/>-->
- <xsl:for-each select="tokenize($graph:property.eval,'\$\{')">
- <xsl:variable name="ifeval" select="contains(.,'}')"/>
-
- <lt>
- <xsl:attribute name="ifeval" select="$ifeval"/>
- <xsl:attribute name="pos" select="position()"/>
- <xsl:attribute name="val" select="."/>
- <xsl:for-each select="tokenize(.,'\}')">
- <rt>
- <xsl:attribute name="pos" select="position()"/>
- <xsl:value-of select="."/>
- </rt>
- </xsl:for-each>
- </lt>
- </xsl:for-each>
- </tokens>
- </xsl:variable>
- <!--<xsl:variable name="property.value" select=" replace($graph:property.eval,'\$','\\\$')"/>-->
- <!--<xsl:variable name="property.value.evaluated" select="$p5dg:p5ant.include.structure//property[]"/>-->
- <xsl:variable name="evaluating">
- <evaluating>
- <xsl:for-each select="$tokens/tokens/lt">
- <xsl:variable name="ifeval" select="@ifeval"/>
- <xsl:for-each select="rt">
- <xsl:choose>
- <xsl:when test="@pos='1'">
- <xsl:choose>
- <xsl:when test=" text()='basedir'">${p5ant:basedir.calculate}</xsl:when>
- <xsl:otherwise>
- <xsl:variable name="evaluated" select="$graph:graph.graph-to-analyze-property.xml//property[@name=current()][1]/concat(@value,@location)"/>
- <xsl:message>#85 looked for current()=<xsl:value-of select="current()"/>, found <xsl:value-of select="$evaluated"/> ; </xsl:message>
- <xsl:choose>
- <xsl:when test="$evaluated">
- <xsl:value-of select="$evaluated"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>{</xsl:text><xsl:value-of select="current()"/><xsl:text>}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:when>
- <xsl:otherwise>
- <!--<xsl:text>F:</xsl:text>--><xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:for-each>
- </evaluating>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test=" contains($evaluating/evaluating/text(),'${')">
- <xsl:message>#104-99 recurrent eval <xsl:value-of select="$evaluating//text()"/></xsl:message>
- <!--<recurse_evaluating>-->
- <!--<xsl:attribute name="evaluating" select="$evaluating/evaluating/text()"/>-->
- <xsl:copy-of select="graph:graph-to-analyze-evaluated.property($evaluating/evaluating/text(),$graph:property.evaluated.recurse_level + 1)"/>
- <!--</recurse_evaluating>-->
- </xsl:when>
- <xsl:otherwise>
- <!--<graph:property.evaluated>-->
- <xsl:value-of select="$evaluating"/>
- <!--</graph:property.evaluated>-->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
-
- </xsl:function>
-
- <!--
-
- <xsl:template mode="graph:graph-to-analyze-evaluated.property" match="graph:graph-to-analyze-evaluated.property">
- <graph:graph.graph-to-analyze-property.xml>
- <xsl:apply-templates mode="#current"/>
- </graph:graph.graph-to-analyze-property.xml>
- </xsl:template>
-
- <xsl:template mode="graph:graph-to-analyze-evaluated.property" match="recurse_evaluating">
- <xsl:value-of select="text()"/>
- </xsl:template>
-
- <xsl:template mode="graph:graph-to-analyze-evaluated.property" match="graph:property.evaluated">
- <xsl:value-of select="text()"/>
- </xsl:template>-->
-
- <!--<xsl:function name="graph:graph-to-analyze-evaluated.property">
- <xsl:param name="property_dollars"/>
- <xsl:value-of select="replace(replace($property_dollars,'\$\{',''),'\}','')"/>
- <!-\- todo multi vals ${dupa}___asd $${dupa} ? -\->
- </xsl:function>-->
-
-
-
-
- <xsl:template match="text()|comment()">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- </xsl:stylesheet>
|