|
|
@@ -17,26 +17,44 @@
|
|
|
<xsl:param name="uuid" required="yes"/>
|
|
|
<!--<xsl:param name="basedir" required="yes"/>-->
|
|
|
<xsl:param name="temp" required="yes"/>
|
|
|
-
|
|
|
+ <xsl:param name="with_RelatedFeatureLoop" select="false()"/>
|
|
|
<!-- template do zlaczenia wszystkich xmli z danymi z dita
|
|
|
description="z plikow temp/$uuid.* buduje $out_task.dita " -->
|
|
|
|
|
|
- <xsl:template name="get_childs_rows">
|
|
|
- <xsl:param name="element-filename" required="yes"/> <!-- prezes1.root_x2f_.d1e1.CRM_PROCES_x2f_.d1e46.CRM_WSKAZNIK_x2f_.d1e51.CRM_LISTA_ZASOBOW.1. -->
|
|
|
- <xsl:param name="path2collection" select="concat($temp,'/')"/> <!-- $basedir,'/' -->
|
|
|
+ <!--<xsl:template name="get_childs_rows">
|
|
|
+ <xsl:param name="element-filename" required="yes"/> <!-\- prezes1.root_x2f_.d1e1.CRM_PROCES_x2f_.d1e46.CRM_WSKAZNIK_x2f_.d1e51.CRM_LISTA_ZASOBOW.1. -\->
|
|
|
+ <xsl:param name="path2collection" select="concat($temp,'/')"/> <!-\- $basedir,'/' -\->
|
|
|
<xsl:variable name="path">
|
|
|
- <xsl:value-of select="concat($path2collection,'?select=',$element-filename,'*.dita.xml.vals.dita')"/> <!-- $element-filename,'-->
|
|
|
+ <xsl:value-of select="concat($path2collection,'?select=',$element-filename,'*.dita.xml.vals.dita')"/> <!-\- $element-filename,'-\->
|
|
|
</xsl:variable>
|
|
|
<xsl:message>#30 otwieram kolekcje $path=<xsl:value-of select="$path"/>; </xsl:message>
|
|
|
|
|
|
- <!--<xsl:variable name="docs" select="collection($path)"/>-->
|
|
|
- <!--<xsl:variable name="docs" select="collection($path)"/>-->
|
|
|
- <!--<xsl:for-each select="$docs">
|
|
|
+ <!-\-<xsl:variable name="docs" select="collection($path)"/>-\->
|
|
|
+ <!-\-<xsl:variable name="docs" select="collection($path)"/>-\->
|
|
|
+ <!-\-<xsl:for-each select="$docs">
|
|
|
<xsl:message>#35 test - cos jest <xsl:value-of select="name()"/></xsl:message>
|
|
|
<xsl:copy-of select="."/>
|
|
|
- </xsl:for-each>-->
|
|
|
+ </xsl:for-each>-\->
|
|
|
<xsl:copy-of select="collection($path)"/>
|
|
|
- </xsl:template>
|
|
|
+ </xsl:template>-->
|
|
|
+
|
|
|
+
|
|
|
+ <!--<xsl:template name="RelatedFeatureLoop">
|
|
|
+ <xsl:param name="element-filename" required="yes"/> <!-\- prezes1.root_x2f_.d1e1.CRM_PROCES_x2f_.d1e46.CRM_WSKAZNIK_x2f_.d1e51.CRM_LISTA_ZASOBOW.1. -\->
|
|
|
+ <xsl:param name="path2collection" select="concat($temp,'/')"/> <!-\- $basedir,'/' -\->
|
|
|
+ <xsl:variable name="path">
|
|
|
+ <xsl:value-of select="concat($path2collection,'?select=',$element-filename,'*.dita.xml.vals.dita')"/> <!-\- $element-filename,'-\->
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:message>#30 otwieram kolekcje $path=<xsl:value-of select="$path"/>; </xsl:message>
|
|
|
+
|
|
|
+ <!-\-<xsl:variable name="docs" select="collection($path)"/>-\->
|
|
|
+ <!-\-<xsl:variable name="docs" select="collection($path)"/>-\->
|
|
|
+ <!-\-<xsl:for-each select="$docs">
|
|
|
+ <xsl:message>#35 test - cos jest <xsl:value-of select="name()"/></xsl:message>
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ </xsl:for-each>-\->
|
|
|
+ <xsl:copy-of select="collection($path)"/>
|
|
|
+ </xsl:template>-->
|
|
|
|
|
|
<xsl:template match="*" mode="root">
|
|
|
<xsl:param name="loop_xpath"/>
|
|
|
@@ -79,6 +97,7 @@
|
|
|
<!-- podstawamy dane z xml na podstawie path -->
|
|
|
<xsl:param name="loop_xpath" select="'root'"/>
|
|
|
<xsl:param name="feature_pos_child" select="1"/> <!-- pierwsze wyzwolenie narzuca 1 - kolejne sa z related -->
|
|
|
+ <xsl:param name="dita_with_id" select="."/>
|
|
|
<xsl:variable name="xml_id" select="@xml_id"/>
|
|
|
<xsl:variable name="RelatedFeaturePos" select="position()"/>
|
|
|
<xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
|
|
|
@@ -113,16 +132,170 @@
|
|
|
<!--<debug_RelatedFeature>
|
|
|
<xsl:copy-of select="$dita_fragment"/>
|
|
|
</debug_RelatedFeature>-->
|
|
|
+ <RelatedFeatureRoot>
|
|
|
+ <xsl:for-each select="$dita_fragment">
|
|
|
+ <xsl:apply-templates mode="RelatedFeature" select="$dita_fragment/RelatedFeatureRoot/*">
|
|
|
+ <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
+ <xsl:with-param name="dita_with_id" select="$dita_with_id"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </xsl:for-each>
|
|
|
+ </RelatedFeatureRoot>
|
|
|
+
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:template match="RelatedFeatureLoop" mode="RelatedFeatureChild">
|
|
|
+ <!-- podstawamy dane z xml na podstawie path -->
|
|
|
+ <xsl:param name="path" select="$temp"/> <!-- budowa sciezki do wchodzenia do struktur - domyslnie zaczyna sie od $temp-->
|
|
|
+ <xsl:param name="feature_pos_child" select="1"/>
|
|
|
+ <xsl:param name="dita_with_id" required="yes"/>
|
|
|
|
|
|
- <xsl:for-each select="$dita_fragment">
|
|
|
- <xsl:apply-templates mode="RelatedFeature" select="$dita_fragment/RelatedFeatureRoot/*">
|
|
|
- <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
- </xsl:apply-templates>
|
|
|
- </xsl:for-each>
|
|
|
+ <xsl:if test="$with_RelatedFeatureLoop">
|
|
|
+ <xsl:variable name="xml_id" select="@xml_id"/>
|
|
|
+ <xsl:variable name="RelatedFeaturePos" select="position()"/>
|
|
|
+ <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
|
|
|
+ <xsl:variable name="system_cache__appinfo:loop_id" select="@system_cache__appinfo:loop_id"/>
|
|
|
+ <xsl:variable name="path">
|
|
|
+ <xsl:value-of select="concat($path,'/',$xml_id,'.',$uuid,'.',$feature_pos_child)"/>
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+ <xsl:message>#157 RelatedFeatureLoop $path=<xsl:value-of select="$path"/>; $xml_id=<xsl:value-of select="$xml_id"/>; $RelatedFeaturePos=<xsl:value-of select="$RelatedFeaturePos"/>; $feature_pos_child=<xsl:value-of select="$feature_pos_child"/>;</xsl:message>
|
|
|
+ <!--<debug26>
|
|
|
+ Will try to put file=<xsl:value-of select="concat($uuid,'.',$loop_xpath,$featureID_name,'.',$RelatedFeaturePos,'.dita.xml.vals.dita')"/>;
|
|
|
+ </debug26>-->
|
|
|
+ <!--<xsl:variable name="dita_fragment" select="doc(concat($basedir,'/temp/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.dita.xml.vals.dita'))"/>-->
|
|
|
+
|
|
|
+ <xsl:variable name="dita_fragment">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" doc-available(concat($temp,'/',$xml_id,'.',$uuid,'.',$feature_pos_child,'/',$uuid,'.out_task.dita.final.xml'))">
|
|
|
+ <xsl:message>#156 INFO Related leaf xml file <xsl:value-of select="concat($temp,'/',$xml_id,'.',$uuid,'.',$feature_pos_child,'/',$uuid,'.out_task.dita.final.xml')"/></xsl:message>
|
|
|
+ <xsl:copy-of select="doc(concat($temp,'/',$xml_id,'.',$uuid,'.',$feature_pos_child,'/',$uuid,'.out_task.dita.final.xml'))"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:comment>#156 INFO no Related leaf xml file <xsl:value-of select="concat($temp,'/',$xml_id,'.',$uuid,'.',$feature_pos_child,'/',$uuid,'.out_task.dita.final.xml')"/>;</xsl:comment>
|
|
|
+ <xsl:message>#156 INFO no Related leaf xml file <xsl:value-of select="concat($temp,'/',$xml_id,'.',$uuid,'.',$feature_pos_child,'/',$uuid,'.out_task.dita.final.xml')"/></xsl:message>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+ <!--<Loop_dita_fragment>
|
|
|
+ <xsl:copy-of select="$dita_fragment"/>
|
|
|
+ </Loop_dita_fragment>-->
|
|
|
+ <xsl:comment>#180 loop $xml_id=<xsl:value-of select="$xml_id"/>; $RelatedFeaturePos=<xsl:value-of select="$RelatedFeaturePos"/>; </xsl:comment>
|
|
|
+
|
|
|
+ <xsl:for-each select="$dita_fragment">
|
|
|
+ <xsl:for-each select="$dita_fragment">
|
|
|
+ <xsl:apply-templates mode="RelatedFeatureLoop" select="$dita_fragment/RelatedFeatureRoot">
|
|
|
+ <xsl:with-param name="dita_with_id" select="$dita_with_id"/>
|
|
|
+ <xsl:with-param name="xml_id" select="$xml_id"/>
|
|
|
+ <xsl:with-param name="path" select="$path"/>
|
|
|
+ <!--<xsl:with-param name="system_cache__appinfo:loop_id" select="$system_cache__appinfo:loop_id"/>-->
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ <!--<xsl:variable name="dita_fragment" select="doc(concat($basedir,'/temp/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))"/>-->
|
|
|
+ <!--<xsl:variable name="dita_fragment">
|
|
|
+ <xsl:call-template name="get_childs_rows">
|
|
|
+ <xsl:with-param name="element-filename" select="concat($uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.')"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:variable>-->
|
|
|
+
|
|
|
+ <!--<debug_RelatedFeature>
|
|
|
+ <xsl:copy-of select="$dita_fragment"/>
|
|
|
+ </debug_RelatedFeature>-->
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="RelatedFeatureRoot" mode="RelatedFeatureLoop"><!-- zejscie po $dita_with_id z powrotem w czasie przetwarzania loop -->
|
|
|
+ <xsl:param name="path" required="yes"/>
|
|
|
+ <xsl:param name="dita_with_id" required="yes"/>
|
|
|
+ <xsl:param name="xml_id" required="yes"/>
|
|
|
+ <!--<xsl:param name="system_cache__appinfo:loop_id" required="yes"/>-->
|
|
|
+ <!--<dita_with_id>
|
|
|
+ <xsl:copy-of select="$dita_with_id"/>
|
|
|
+ </dita_with_id>-->
|
|
|
+ <!--<RelatedFeatureLoop>-->
|
|
|
+ <xsl:comment>#211 $path=<xsl:value-of select="$path"/>; </xsl:comment>
|
|
|
+ <!--<xsl:copy-of select="."/>-->
|
|
|
+
|
|
|
+ <xsl:for-each select="*">
|
|
|
+ <xsl:variable name="loop_pos" select="position()"/>
|
|
|
+ <xsl:variable name="current" select="."/>
|
|
|
+ <xsl:variable name="find_Child_RelatedFeatureLoop"><!-- tutaj dowiemy sie jakie moga byc odgalezienia do wstawienia -->
|
|
|
+ <find_Child_RelatedFeatureLoop>
|
|
|
+ <xsl:apply-templates mode="find_Child_RelatedFeatureLoop" select="$dita_with_id"/>
|
|
|
+ </find_Child_RelatedFeatureLoop>
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+ <!--<find_Child_RelatedFeatureLoop>
|
|
|
+ <xsl:copy-of select="$find_Child_RelatedFeatureLoop"/>
|
|
|
+ </find_Child_RelatedFeatureLoop>-->
|
|
|
+ <!--<test>-->
|
|
|
+ <xsl:element name="{$current/name()}">
|
|
|
+ <!--<current>-->
|
|
|
+ <xsl:for-each select="$current/*">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="name()='RelatedFeatureRoot'"/>
|
|
|
+ <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
+ <!--</current>-->
|
|
|
+ <xsl:for-each select="$find_Child_RelatedFeatureLoop/find_Child_RelatedFeatureLoop/RelatedFeatureLoop">
|
|
|
+
|
|
|
+ <xsl:variable name="path">
|
|
|
+ <xsl:value-of select="concat($path,'/',@xml_id,'.',$uuid,'.',$loop_pos)"/>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:comment>#220 $path=<xsl:value-of select="$path"/>; </xsl:comment>
|
|
|
+ <xsl:variable name="dita_fragment">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" doc-available(concat($path,'/',$uuid,'.out_task.dita.final.xml'))">
|
|
|
+ <xsl:message>#221 INFO Related leaf xml file <xsl:value-of select="concat($path,'/',$uuid,'.out_task.dita.final.xml')"/></xsl:message>
|
|
|
+ <xsl:copy-of select="doc(concat($path,'/',$uuid,'.out_task.dita.final.xml'))"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:comment>#221 INFO no Related leaf xml file <xsl:value-of select="concat($path,'/',$uuid,'.out_task.dita.final.xml')"/>;</xsl:comment>
|
|
|
+ <xsl:message>#221 INFO no Related leaf xml file <xsl:value-of select="concat($path,'/',$uuid,'.out_task.dita.final.xml')"/></xsl:message>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+
|
|
|
+ <!--<dita>-->
|
|
|
+ <!--<xsl:copy-of select="$dita_fragment/RelatedFeatureRoot/*"/>-->
|
|
|
+ <!--</dita>-->
|
|
|
+ <!--<child_recurs>-->
|
|
|
+ <xsl:apply-templates select="$dita_fragment" mode="RelatedFeatureLoop">
|
|
|
+ <xsl:with-param name="path" select="$path"/>
|
|
|
+ <xsl:with-param name="feature_pos_child" select="$loop_pos"/>
|
|
|
+ <xsl:with-param name="dita_with_id" select="$dita_with_id"/>
|
|
|
+ <xsl:with-param name="xml_id" select="@xml_id"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ <!--</child_recurs>-->
|
|
|
+ <!-- cofniecie sie do wlasciwego dita_with_id -->
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:element>
|
|
|
+ <!--</test>-->
|
|
|
+
|
|
|
+ </xsl:for-each>
|
|
|
+ <!--</RelatedFeatureLoop>-->
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:template mode="find_Child_RelatedFeatureLoop" match="*|text()|comment()">
|
|
|
+ <xsl:apply-templates mode="find_Child_RelatedFeatureLoop"/>
|
|
|
</xsl:template>
|
|
|
|
|
|
+ <xsl:template mode="find_Child_RelatedFeatureLoop" match="RelatedFeatureLoop">
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<xsl:template mode="RelatedFeature" match="*">
|
|
|
<xsl:param name="loop_xpath" required="yes"/>
|
|
|
+ <xsl:param name="dita_with_id" required="yes"/>
|
|
|
<!--<xsl:element name="{name()}">-->
|
|
|
<!--<xsl:copy-of select="@*"/>-->
|
|
|
<!--<xsl:apply-templates select="@*"/>-->
|
|
|
@@ -130,6 +303,7 @@
|
|
|
<xsl:apply-templates mode="RelatedFeatureChild" select=".">
|
|
|
<xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
<xsl:with-param name="feature_pos_child" select="position()"/>
|
|
|
+ <xsl:with-param name="dita_with_id" select="$dita_with_id"/>
|
|
|
</xsl:apply-templates>
|
|
|
<!--</xsl:element>-->
|
|
|
</xsl:template>
|
|
|
@@ -137,12 +311,14 @@
|
|
|
<xsl:template mode="RelatedFeatureChild" match="*">
|
|
|
<xsl:param name="loop_xpath" required="yes"/>
|
|
|
<xsl:param name="feature_pos_child" required="yes"/>
|
|
|
+ <xsl:param name="dita_with_id" required="yes"/>
|
|
|
<xsl:element name="{name()}">
|
|
|
<!--<xsl:copy-of select="@*"/>-->
|
|
|
<xsl:apply-templates select="@*"/>
|
|
|
<xsl:apply-templates mode="RelatedFeatureChild">
|
|
|
<xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
<xsl:with-param name="feature_pos_child" select="$feature_pos_child"/>
|
|
|
+ <xsl:with-param name="dita_with_id" select="$dita_with_id"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:element>
|
|
|
</xsl:template>
|
|
|
@@ -150,20 +326,24 @@
|
|
|
<xsl:template mode="RelatedFeatureChild" match="RelatedFeature">
|
|
|
<xsl:param name="loop_xpath" required="yes"/>
|
|
|
<xsl:param name="feature_pos_child" required="yes"/>
|
|
|
+ <xsl:param name="dita_with_id" required="yes"/>
|
|
|
<xsl:apply-templates select=".">
|
|
|
<xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
<xsl:with-param name="feature_pos_child" select="$feature_pos_child"/>
|
|
|
+ <xsl:with-param name="dita_with_id" select="$dita_with_id"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:template>
|
|
|
|
|
|
<xsl:template match="*" >
|
|
|
<xsl:param name="loop_xpath"/>
|
|
|
<xsl:param name="feature_pos_child" required="yes"/>
|
|
|
+ <xsl:param name="dita_with_id" required="yes"/>
|
|
|
<xsl:element name="{name()}">
|
|
|
<xsl:copy-of select="@*"/>
|
|
|
<xsl:apply-templates>
|
|
|
<xsl:with-param name="loop_xpath" select="$loop_xpath"/>
|
|
|
<xsl:with-param name="feature_pos_child" select="$feature_pos_child"/>
|
|
|
+ <xsl:with-param name="dita_with_id" select="$dita_with_id"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:element>
|
|
|
</xsl:template>
|