Browse Source

dzialajaca rekurencja - sklada refy do podkatalogu w temp do nazwanego pliku w temp /node_id()/$uuid.out_task.dita.final.xml - teraz tylko zmergowac po mapie i jest drzewo.

symulowane refy implementuja restrykcje po simpleType w polach np TYPE=PROCES_INIT . Rekurencyjne wyzwolenie anta musialo pojsc przez exec, z racji zapamietywania properties dla danego antfile i jego dzieci.
a.binder 9 years ago
parent
commit
0c2c8776e4

+ 26 - 16
SE/schema/ant-url_action/default_db.crm_proces/CRM_PROCES_tree/build.xml

@@ -31,11 +31,11 @@
         -DtypeName="p5_default_db:IN7_DZIENNIK_KORESP" 
         -Dxpath=ID -Dxpath_value=1000 
         -Duuid=1 -DwebRootUrl=somePathDir-->
-    <property name="temp" value="temp"/> <!-- temp files-->
+    <property name="basedir"  value="${basedir}"/> <!-- do ustalenia glownego katalogu -->
     <property name="out" value="out"/> <!-- output ready files like pdf -->
-    <property name="p5_tr_map_dir" location="../../../default_db.instance.xml/p5_tr_map" />
-    <property name="detect_resource_type_dir" location="../../../default_db.instance.xml/detect_resource_type" />
-    <property name="build_complexType_dir" location="../../../default_db.instance.xml/build_complexType" />
+    <property name="p5_tr_map_dir" location="${basedir}/../../../default_db.instance.xml/p5_tr_map" />
+    <property name="detect_resource_type_dir" location="${basedir}/../../../default_db.instance.xml/detect_resource_type" />
+    <property name="build_complexType_dir" location="${basedir}/../../../default_db.instance.xml/build_complexType" />
     
     <property name="uuid" value="${uuid}"/> <!--TODO-->
     <property name="passwordBase64Basic" value="${passwordBase64Basic}"/>
@@ -50,18 +50,24 @@
     <property name="xpath" value="${xpath}"/> <!-- to be set initially like as key to search ID  -->
     <property name="xpath_value" value="${xpath_value}"/> <!-- to be set initially like 1000 (to search ID=1000, if ID we get by featureID  -->
     
-    <property name="loop_path" value=""/>  <!-- w przypadku podania, system powinien w tym katalogu zapisywac wynik xml dzialania, azeby odbudowac rekursywne drzewo - zapisujemy po system_cache__appinfo:id np bedzie ${temp}/${uuid}_CRM_PROCES___d14e4479-1_PROCES_BEN/  -->
-    
+    <property name="loop_path_recurs" value=""/>  <!-- w przypadku podania, system powinien w tym katalogu zapisywac wynik xml dzialania, azeby odbudowac rekursywne drzewo - zapisujemy po system_cache__appinfo:id np bedzie ${temp}/${uuid}_CRM_PROCES___d14e4479-1_PROCES_BEN/  -->
+    <property name="temp" value="${basedir}/temp${loop_path_recurs}"/> <!-- temp files-->
     <!-- variables to first transform of doc for then get related features -->
     <!--<property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>--> <!-- katalog z xsl z projektu src-xmlschema.git -->
     
     <!--<tempfile property="uuid" deleteonexit="yes"/>-->
-    <tempfile property="out_task.dita" deleteonexit="no"  destdir="temp"/>
-    <tempfile property="out_task.dita.final" deleteonexit="no"  destdir="temp"/>
+    <property name="out_task.dita"  value="${temp}/${uuid}.out_task_dita"/>
+    <property name="out_task.dita.final"   value="${temp}/${uuid}.out_task.dita.final"/>
     <!--<tempfile property="wfs_output" deleteonexit="no"  destdir="temp"  suffix=".xml" />-->
     
-    <record name="${temp}/ant.log" loglevel="verbose" append="true"/>
-    
+
+    <!--<record name="${temp}/ant.log" loglevel="verbose" append="true"/>-->
+
+    <echo> $basedir=${basedir}; 
+        $temp=${temp};
+        $loop_path_recurs=${loop_path_recurs};
+    </echo>
+
     <!-- uuid -->
     <target name="uuid_cond">
         <condition property="uuid_set" taskname="uuid_check">
@@ -262,7 +268,7 @@
                         <echo message="OUTPUT__START"/>
                         
                         <!-- TODO proba wlaczenia rekursywnosci zapisanie wezla do sciezki w folderze-->
-                        <copy file="${out_task.dita.final}" tofile="${temp}/${loop_path}/${uuid_tested}.loop_path.xml" />
+                        <!--<copy file="${out_task.dita.final}" tofile="${temp}/${loop_path_recurs}/${uuid_tested}.loop_path.xml" />-->
                         
                         <move file="${out_task.dita.final}" tofile="${out_task.dita.final}.xml"/>
                         
@@ -324,12 +330,11 @@
     </target>
     
     <target name="check_default_db_xml_cache.public_default" depends="set_default_db_xml_cache.public_local" unless="${set_default_db_xml_cache.public_local}">
-        <echo> Ustawiamy ../../../default_db_xml_cache.public</echo>
-        <property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>
+        <echo> Ustawiamy ${basedir}/../../../default_db_xml_cache.public</echo>
+        <property name="default_db_xml_cache.public" value="${basedir}/../../../default_db_xml_cache.public"/>
         <property name="build_recurse_ant.xsl" value="${default_db_xml_cache.public}/build_recurse_ant.xsl"/>
         <property name="build_recurse_ant_merge_dita_from_temp.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_merge_dita_from_temp.xsl"/>
         <property name="builds_to_ant.xsl" value="${default_db_xml_cache.public}/builds_to_ant.xsl"/>
-        
     </target>
     
     
@@ -406,9 +411,14 @@
             <param name="temp" expression="${temp}"/>
             <param name="builds_to_ant.xsl" expression="${builds_to_ant.xsl}"/>
             <param name="cookie_curl_option" expression="${php_session_id_tested}"/>
+            <param name="loop_path_recurs" expression="${loop_path_recurs}"/>
+
         </xslt>
         <!--<import file="${build_recurse_ant.xml}"/>-->
-        <ant  antfile="${build_recurse_ant.xml}" dir="."/>
+        <ant  antfile="${build_recurse_ant.xml}" dir="." >
+            <property name="" value=""></property>
+        </ant>
+        
         <!-- pozbierac wszystkie do kupy xmle  -->
     </target>
     
@@ -421,7 +431,7 @@
             <!--<param name="webRootUrl" expression="${webRootUrl}" />--> 
             <!--<param name="main_build_recurse_ant.dita" expression="${main_build_recurse_ant.dita}"/>-->
             <param name="uuid" expression="${uuid_tested}"/>
-            <param name="basedir" expression="${basedir}"/>
+            <!--<param name="basedir" expression="${basedir}"/>-->
             <param name="temp" expression="${temp}"/>
         </xslt>
         <echo> zapisalem plik gotowy do utworzenia dita do ${out_task.dita}. </echo>

+ 26 - 16
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/build.xml

@@ -31,11 +31,11 @@
         -DtypeName="p5_default_db:IN7_DZIENNIK_KORESP" 
         -Dxpath=ID -Dxpath_value=1000 
         -Duuid=1 -DwebRootUrl=somePathDir-->
-    <property name="temp" value="temp"/> <!-- temp files-->
+    <property name="basedir"  value="${basedir}"/> <!-- do ustalenia glownego katalogu -->
     <property name="out" value="out"/> <!-- output ready files like pdf -->
-    <property name="p5_tr_map_dir" location="../../../default_db.instance.xml/p5_tr_map" />
-    <property name="detect_resource_type_dir" location="../../../default_db.instance.xml/detect_resource_type" />
-    <property name="build_complexType_dir" location="../../../default_db.instance.xml/build_complexType" />
+    <property name="p5_tr_map_dir" location="${basedir}/../../../default_db.instance.xml/p5_tr_map" />
+    <property name="detect_resource_type_dir" location="${basedir}/../../../default_db.instance.xml/detect_resource_type" />
+    <property name="build_complexType_dir" location="${basedir}/../../../default_db.instance.xml/build_complexType" />
     
     <property name="uuid" value="${uuid}"/> <!--TODO-->
     <property name="passwordBase64Basic" value="${passwordBase64Basic}"/>
@@ -50,18 +50,24 @@
     <property name="xpath" value="${xpath}"/> <!-- to be set initially like as key to search ID  -->
     <property name="xpath_value" value="${xpath_value}"/> <!-- to be set initially like 1000 (to search ID=1000, if ID we get by featureID  -->
     
-    <property name="loop_path" value=""/>  <!-- w przypadku podania, system powinien w tym katalogu zapisywac wynik xml dzialania, azeby odbudowac rekursywne drzewo - zapisujemy po system_cache__appinfo:id np bedzie ${temp}/${uuid}_CRM_PROCES___d14e4479-1_PROCES_BEN/  -->
-    
+    <property name="loop_path_recurs" value=""/>  <!-- w przypadku podania, system powinien w tym katalogu zapisywac wynik xml dzialania, azeby odbudowac rekursywne drzewo - zapisujemy po system_cache__appinfo:id np bedzie ${temp}/${uuid}_CRM_PROCES___d14e4479-1_PROCES_BEN/  -->
+    <property name="temp" value="${basedir}/temp${loop_path_recurs}"/> <!-- temp files-->
     <!-- variables to first transform of doc for then get related features -->
     <!--<property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>--> <!-- katalog z xsl z projektu src-xmlschema.git -->
     
     <!--<tempfile property="uuid" deleteonexit="yes"/>-->
-    <tempfile property="out_task.dita" deleteonexit="no"  destdir="temp"/>
-    <tempfile property="out_task.dita.final" deleteonexit="no"  destdir="temp"/>
+    <property name="out_task.dita"  value="${temp}/${uuid}.out_task_dita"/>
+    <property name="out_task.dita.final"   value="${temp}/${uuid}.out_task.dita.final"/>
     <!--<tempfile property="wfs_output" deleteonexit="no"  destdir="temp"  suffix=".xml" />-->
     
-    <record name="${temp}/ant.log" loglevel="verbose" append="true"/>
-    
+
+    <!--<record name="${temp}/ant.log" loglevel="verbose" append="true"/>-->
+
+    <echo> $basedir=${basedir}; 
+        $temp=${temp};
+        $loop_path_recurs=${loop_path_recurs};
+    </echo>
+
     <!-- uuid -->
     <target name="uuid_cond">
         <condition property="uuid_set" taskname="uuid_check">
@@ -262,7 +268,7 @@
                         <echo message="OUTPUT__START"/>
                         
                         <!-- TODO proba wlaczenia rekursywnosci zapisanie wezla do sciezki w folderze-->
-                        <copy file="${out_task.dita.final}" tofile="${temp}/${loop_path}/${uuid_tested}.loop_path.xml" />
+                        <!--<copy file="${out_task.dita.final}" tofile="${temp}/${loop_path_recurs}/${uuid_tested}.loop_path.xml" />-->
                         
                         <move file="${out_task.dita.final}" tofile="${out_task.dita.final}.xml"/>
                         
@@ -324,12 +330,11 @@
     </target>
     
     <target name="check_default_db_xml_cache.public_default" depends="set_default_db_xml_cache.public_local" unless="${set_default_db_xml_cache.public_local}">
-        <echo> Ustawiamy ../../../default_db_xml_cache.public</echo>
-        <property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>
+        <echo> Ustawiamy ${basedir}/../../../default_db_xml_cache.public</echo>
+        <property name="default_db_xml_cache.public" value="${basedir}/../../../default_db_xml_cache.public"/>
         <property name="build_recurse_ant.xsl" value="${default_db_xml_cache.public}/build_recurse_ant.xsl"/>
         <property name="build_recurse_ant_merge_dita_from_temp.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_merge_dita_from_temp.xsl"/>
         <property name="builds_to_ant.xsl" value="${default_db_xml_cache.public}/builds_to_ant.xsl"/>
-        
     </target>
     
     
@@ -406,9 +411,14 @@
             <param name="temp" expression="${temp}"/>
             <param name="builds_to_ant.xsl" expression="${builds_to_ant.xsl}"/>
             <param name="cookie_curl_option" expression="${php_session_id_tested}"/>
+            <param name="loop_path_recurs" expression="${loop_path_recurs}"/>
+
         </xslt>
         <!--<import file="${build_recurse_ant.xml}"/>-->
-        <ant  antfile="${build_recurse_ant.xml}" dir="."/>
+        <ant  antfile="${build_recurse_ant.xml}" dir="." >
+            <property name="" value=""></property>
+        </ant>
+        
         <!-- pozbierac wszystkie do kupy xmle  -->
     </target>
     
@@ -421,7 +431,7 @@
             <!--<param name="webRootUrl" expression="${webRootUrl}" />--> 
             <!--<param name="main_build_recurse_ant.dita" expression="${main_build_recurse_ant.dita}"/>-->
             <param name="uuid" expression="${uuid_tested}"/>
-            <param name="basedir" expression="${basedir}"/>
+            <!--<param name="basedir" expression="${basedir}"/>-->
             <param name="temp" expression="${temp}"/>
         </xslt>
         <echo> zapisalem plik gotowy do utworzenia dita do ${out_task.dita}. </echo>

+ 26 - 16
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/umowa/build.xml

@@ -31,11 +31,11 @@
         -DtypeName="p5_default_db:IN7_DZIENNIK_KORESP" 
         -Dxpath=ID -Dxpath_value=1000 
         -Duuid=1 -DwebRootUrl=somePathDir-->
-    <property name="temp" value="temp"/> <!-- temp files-->
+    <property name="basedir"  value="${basedir}"/> <!-- do ustalenia glownego katalogu -->
     <property name="out" value="out"/> <!-- output ready files like pdf -->
-    <property name="p5_tr_map_dir" location="../../../default_db.instance.xml/p5_tr_map" />
-    <property name="detect_resource_type_dir" location="../../../default_db.instance.xml/detect_resource_type" />
-    <property name="build_complexType_dir" location="../../../default_db.instance.xml/build_complexType" />
+    <property name="p5_tr_map_dir" location="${basedir}/../../../default_db.instance.xml/p5_tr_map" />
+    <property name="detect_resource_type_dir" location="${basedir}/../../../default_db.instance.xml/detect_resource_type" />
+    <property name="build_complexType_dir" location="${basedir}/../../../default_db.instance.xml/build_complexType" />
     
     <property name="uuid" value="${uuid}"/> <!--TODO-->
     <property name="passwordBase64Basic" value="${passwordBase64Basic}"/>
@@ -50,18 +50,24 @@
     <property name="xpath" value="${xpath}"/> <!-- to be set initially like as key to search ID  -->
     <property name="xpath_value" value="${xpath_value}"/> <!-- to be set initially like 1000 (to search ID=1000, if ID we get by featureID  -->
     
-    <property name="loop_path" value=""/>  <!-- w przypadku podania, system powinien w tym katalogu zapisywac wynik xml dzialania, azeby odbudowac rekursywne drzewo - zapisujemy po system_cache__appinfo:id np bedzie ${temp}/${uuid}_CRM_PROCES___d14e4479-1_PROCES_BEN/  -->
-    
+    <property name="loop_path_recurs" value=""/>  <!-- w przypadku podania, system powinien w tym katalogu zapisywac wynik xml dzialania, azeby odbudowac rekursywne drzewo - zapisujemy po system_cache__appinfo:id np bedzie ${temp}/${uuid}_CRM_PROCES___d14e4479-1_PROCES_BEN/  -->
+    <property name="temp" value="${basedir}/temp${loop_path_recurs}"/> <!-- temp files-->
     <!-- variables to first transform of doc for then get related features -->
     <!--<property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>--> <!-- katalog z xsl z projektu src-xmlschema.git -->
     
     <!--<tempfile property="uuid" deleteonexit="yes"/>-->
-    <tempfile property="out_task.dita" deleteonexit="no"  destdir="temp"/>
-    <tempfile property="out_task.dita.final" deleteonexit="no"  destdir="temp"/>
+    <property name="out_task.dita"  value="${temp}/${uuid}.out_task_dita"/>
+    <property name="out_task.dita.final"   value="${temp}/${uuid}.out_task.dita.final"/>
     <!--<tempfile property="wfs_output" deleteonexit="no"  destdir="temp"  suffix=".xml" />-->
     
-    <record name="${temp}/ant.log" loglevel="verbose" append="true"/>
-    
+
+    <!--<record name="${temp}/ant.log" loglevel="verbose" append="true"/>-->
+
+    <echo> $basedir=${basedir}; 
+        $temp=${temp};
+        $loop_path_recurs=${loop_path_recurs};
+    </echo>
+
     <!-- uuid -->
     <target name="uuid_cond">
         <condition property="uuid_set" taskname="uuid_check">
@@ -262,7 +268,7 @@
                         <echo message="OUTPUT__START"/>
                         
                         <!-- TODO proba wlaczenia rekursywnosci zapisanie wezla do sciezki w folderze-->
-                        <copy file="${out_task.dita.final}" tofile="${temp}/${loop_path}/${uuid_tested}.loop_path.xml" />
+                        <!--<copy file="${out_task.dita.final}" tofile="${temp}/${loop_path_recurs}/${uuid_tested}.loop_path.xml" />-->
                         
                         <move file="${out_task.dita.final}" tofile="${out_task.dita.final}.xml"/>
                         
@@ -324,12 +330,11 @@
     </target>
     
     <target name="check_default_db_xml_cache.public_default" depends="set_default_db_xml_cache.public_local" unless="${set_default_db_xml_cache.public_local}">
-        <echo> Ustawiamy ../../../default_db_xml_cache.public</echo>
-        <property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>
+        <echo> Ustawiamy ${basedir}/../../../default_db_xml_cache.public</echo>
+        <property name="default_db_xml_cache.public" value="${basedir}/../../../default_db_xml_cache.public"/>
         <property name="build_recurse_ant.xsl" value="${default_db_xml_cache.public}/build_recurse_ant.xsl"/>
         <property name="build_recurse_ant_merge_dita_from_temp.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_merge_dita_from_temp.xsl"/>
         <property name="builds_to_ant.xsl" value="${default_db_xml_cache.public}/builds_to_ant.xsl"/>
-        
     </target>
     
     
@@ -406,9 +411,14 @@
             <param name="temp" expression="${temp}"/>
             <param name="builds_to_ant.xsl" expression="${builds_to_ant.xsl}"/>
             <param name="cookie_curl_option" expression="${php_session_id_tested}"/>
+            <param name="loop_path_recurs" expression="${loop_path_recurs}"/>
+
         </xslt>
         <!--<import file="${build_recurse_ant.xml}"/>-->
-        <ant  antfile="${build_recurse_ant.xml}" dir="."/>
+        <ant  antfile="${build_recurse_ant.xml}" dir="." >
+            <property name="" value=""></property>
+        </ant>
+        
         <!-- pozbierac wszystkie do kupy xmle  -->
     </target>
     
@@ -421,7 +431,7 @@
             <!--<param name="webRootUrl" expression="${webRootUrl}" />--> 
             <!--<param name="main_build_recurse_ant.dita" expression="${main_build_recurse_ant.dita}"/>-->
             <param name="uuid" expression="${uuid_tested}"/>
-            <param name="basedir" expression="${basedir}"/>
+            <!--<param name="basedir" expression="${basedir}"/>-->
             <param name="temp" expression="${temp}"/>
         </xslt>
         <echo> zapisalem plik gotowy do utworzenia dita do ${out_task.dita}. </echo>

+ 386 - 36
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -51,9 +51,10 @@
     
     <xsl:param name="xml_id_parent" select="@xml_id"/>
     <xsl:param name="build_recurse_ant.xsl" required="yes"/>
-    <xsl:param name="temp" select="'temp'"/>
+    <xsl:param name="temp"  required="yes"/>
     <xsl:param name="builds_to_ant.xsl" required="yes"/>
     <xsl:param name="cookie_curl_option" required="yes"/>
+    <xsl:param name="loop_path_recurs" required="yes" /> <!-- loop path dla gromadzenia plikow dla RelatedFeatureLoop do przetworzen w rekurencji - domysmnie pusty, potem sie dobudowuje po wyzwoleniu anta w glab -->
     <!-- second step fist loop - with data -->
     <!--<xsl:param name="wfs_output.xml"/>--> <!-- to be set in second step by ant build generated by this style to fill by its data childs -->
     
@@ -87,6 +88,7 @@
         <xsl:param name="loop_xpath_save" select="$loop_xpath_save"/><!-- tutaj zapisal sie build z wezla z parent -->
         <xsl:param name="input_obj_with_xpath" /> <!-- przekazany z template  match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
         <xsl:param name="feature_pos"  select="1"/> <!-- przekazany z  template  match="RelatedFeature" mode="after_first_ant_assing_vars_childs"-->
+        <xsl:param name="loop_path_recurs"  select="$loop_path_recurs"/> <!-- przekazany z RelatedFeatureLoop z mode="after_first_ant_assing_vars_childs"  -->
         <xsl:choose>
             <xsl:when test="name()='RelatedFeature'">
                 <xsl:variable name="RelatedFeatureCount" select="last()"/>
@@ -112,9 +114,22 @@
                 <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.dita.xml')"/>
                 <!--<xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.','.dita.xml')"/>-->
                 <!-- dane z oczekiwanego template .dita -->
-                <xsl:variable name="xpath_dita" select="@xpath"/>
+                <xsl:variable name="xpath_dita">
+                    <xsl:choose>
+                        <xsl:when test=" string-length($xpath) &gt;0">
+                            <xsl:value-of select="$xpath"/>
+                            <xsl:message>#121 narzucam $xpath=(<xsl:value-of select="$xpath"/>) z wyzwolenia build.xml </xsl:message>
+                        </xsl:when>
+                        <xsl:otherwise><xsl:value-of select="@xpath"/></xsl:otherwise>
+                    </xsl:choose>
+                </xsl:variable>
+                
                 <xsl:variable name="xpath_value_dita">
                     <xsl:choose>
+                        <xsl:when test="string-length($xpath_value) &gt;0">
+                            <xsl:message>#67.0 $xpath_value=(<xsl:value-of select="$xpath_value"/>); narzucone pewnie z wyzwolenia build.xml</xsl:message>
+                            <xsl:value-of select="$xpath_value"/>
+                        </xsl:when>
                         <xsl:when test="@xpath_value">
                             <!--<xsl:variable name="xpath_value_tokens" select="tokenize(@xpath_value,'/')"/>-->
                             <!--<xsl:value-of select="'todo zapytanie xpath do przetworzenia'"/>-->
@@ -150,6 +165,10 @@
                         <xsl:attribute name="name" select="'passwordBase64Basic'"/>
                         <xsl:attribute name="value" select="$passwordBase64Basic"/>
                     </xsl:element>
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'php_session_id'"/>
+                        <xsl:attribute name="value" select="$cookie_curl_option"/>
+                    </xsl:element>
                     <xsl:element name="property">
                         <xsl:attribute name="name" select="'url'"/>
                         <xsl:attribute name="value" select="$url"/>
@@ -170,6 +189,11 @@
                         <xsl:attribute name="name" select="'builds_to_ant.xsl'"/>
                         <xsl:attribute name="value" select="$builds_to_ant.xsl"/>
                     </xsl:element>
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'loop_path_recurs'"/>
+                        <xsl:attribute name="value" select="$loop_path_recurs"/>
+                    </xsl:element>
+                    
                     <xsl:comment>
                         Important variables:
                         typeName=<xsl:value-of select="$typeName"/>;
@@ -177,7 +201,6 @@
                         xpath_value=<xsl:value-of select="$xpath_value"/>;
                         $passwordBase64Basic=<xsl:value-of select="$passwordBase64Basic"/>
                     </xsl:comment>
-
                     <xsl:apply-templates mode="ant_target" select=".">
                         <xsl:with-param name="typeName_dita" select="$typeName_dita"/>
                         <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
@@ -242,6 +265,9 @@
                             <xsl:with-param name="uuid" select="$uuid"/>
                             <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
                             <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
+                            <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
+                            <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
+                            <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
                         </xsl:apply-templates>
                     </xsl:element>
                     <!-- na koniec przetwarzania danego zaglebienia uruchamiamy calosc ponownie do kolejnego zaglebienia -->
@@ -251,6 +277,235 @@
                     <!-- jak nie ma zaglebien to generujemy pdf i dajemy uzytkownikowi linka  -->
                 </project>
             </xsl:when>
+            <xsl:when test="name()='RelatedFeatureLoop'">
+                <xsl:message>#255 RelatedFeatureLoop - try to execute child ant in loop_path=xml_id(<xsl:value-of select="@xml_id"/>)</xsl:message>
+                <xsl:variable name="RelatedFeatureCount" select="last()"/>
+                <xsl:variable name="RelatedFeaturePos" select="position()"/>
+                <xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
+                <xsl:variable name="loop_xpath_real" select="$loop_xpath"/>
+                <xsl:variable name="loop_xpath">
+                    <xsl:choose>
+                        <xsl:when test="$loop_xpath='root'">
+                            <xsl:value-of select="concat($loop_xpath,'_x2f_.',@xml_id,'.',$featureID_name)"/>
+                        </xsl:when>
+                        <xsl:otherwise><xsl:value-of select="$loop_xpath"/></xsl:otherwise>
+                    </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="typeName_dita" select="@typeName"/>
+                <xsl:variable name="featureID_name_dita" select="substring-after($typeName_dita,':')"/>
+                <xsl:variable name="xml_id" select="@xml_id"/>
+                <xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath)"/>
+                <xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.xml')"/>
+                <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.dita.xml')"/>
+                <xsl:variable name="xpath_dita" select="@xpath"/>
+                <xsl:variable name="xpath_value_dita">
+                    <xsl:choose>
+                        <xsl:when test="@xpath_value">
+                            <xsl:message>#265.1 $input_obj_with_xpath: <xsl:copy-of select="$input_obj_with_xpath"/> </xsl:message>
+                            <xsl:call-template name="xpath_filter_apply">
+                                <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
+                                <xsl:with-param name="xpath" select="@xpath"/>
+                                <xsl:with-param name="xpath_value" select="@xpath_value"/>
+                            </xsl:call-template>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:value-of select="$xpath_value"/><!-- parametr z template narzuca wartosc -->
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:variable>
+                <xsl:comment>
+                    RelatedFeatureLoop:
+                        $typeName_dita= <xsl:value-of select="$typeName_dita"/>
+                        $featureID_name_dita= <xsl:value-of select="$featureID_name_dita"/>
+                        $wfs_output= <xsl:value-of select="$wfs_output"/>
+                        $wfs_output.xml= <xsl:value-of select="$wfs_output.xml"/>
+                        $wfs_output.dita= <xsl:value-of select="$wfs_output.dita"/>
+                        $xpath_dita= <xsl:value-of select="$xpath_dita"/>
+                       $xpath_value_dita= <xsl:value-of select="$xpath_value_dita"/>
+                </xsl:comment>
+                <project basedir="{$basedir}" name="get_related_feature{$loop_xpath_real}_{$loop_path_recurs}" default="get_related_feature_run_child_ant{$loop_xpath_real}_{$loop_path_recurs}">
+                    <xsl:comment>RelatedFeatureCount:<xsl:value-of select="count(*)"/></xsl:comment>
+                    <echo> ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>; projekt <xsl:value-of select="$loop_xpath_real"/>; </echo>
+                    <!--<xsl:variable name="typeName" select='replace($typeName,"&quot;","")'/>--><!-- oczyszczenie z apostrofow -->
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'uuid'"/>
+                        <xsl:attribute name="value" select="$uuid"/>
+                    </xsl:element>
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'passwordBase64Basic'"/>
+                        <xsl:attribute name="value" select="$passwordBase64Basic"/>
+                    </xsl:element>
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'php_session_id'"/>
+                        <xsl:attribute name="value" select="$cookie_curl_option"/>
+                    </xsl:element>
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'php_session_id_tested'"/>
+                        <xsl:attribute name="value" select="$cookie_curl_option"/>
+                    </xsl:element>
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'url'"/>
+                        <xsl:attribute name="value" select="$url"/>
+                    </xsl:element>
+                    <xsl:element name="property">
+                        <xsl:attribute name="name" select="'webRootUrl'"/>
+                        <xsl:attribute name="value" select="$webRootUrl"/>
+                    </xsl:element>
+                    <xsl:element name="property"> <!--- powinien miec domyslnie sciezke narzucona-->
+                        <xsl:attribute name="name" select="'build_recurse_ant.xsl'"/>
+                        <xsl:attribute name="value" select="$build_recurse_ant.xsl"/>
+                    </xsl:element>
+                    <!--<xsl:element name="property"> <!-\-\- powinien miec domyslnie narzucona sciezke-\->
+                        <xsl:attribute name="name" select="'temp'"/>
+                        <xsl:attribute name="value" select="$temp"/>
+                    </xsl:element>-->
+                    <xsl:element name="property"><!-- - powinien miec sciezke domyslnie narzucona-->
+                        <xsl:attribute name="name" select="'builds_to_ant.xsl'"/>
+                        <xsl:attribute name="value" select="$builds_to_ant.xsl"/>
+                    </xsl:element>
+                    <property name="typeName" value="{$typeName}"/>
+                    <property name="xpath" value="{$xpath_dita}"/>
+                    <property name="xpath_value" value="{$xpath_value_dita}"/>
+<!--                        DtypeName=p5_default_db:CRM_PROCES -Dxpath=ID -Dxpath_value=5247 -->
+                    <property name="loop_path_recurs" value="{$loop_path_recurs}"/>
+                    <xsl:comment>
+                        Important variables:
+                        typeName=<xsl:value-of select="$typeName"/>;
+                        xpath=<xsl:value-of select="$xpath"/>;
+                        xpath_value=<xsl:value-of select="$xpath_value"/>;
+                        $passwordBase64Basic=<xsl:value-of select="$passwordBase64Basic"/>
+                    </xsl:comment>
+                    <!--<xsl:apply-templates mode="ant_target" select=".">
+                        <xsl:with-param name="typeName_dita" select="$typeName_dita"/>
+                        <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
+                        <xsl:with-param name="wfs_output" select="$wfs_output"/>
+                        <xsl:with-param name="wfs_output.xml" select="$wfs_output.xml"/>
+                        <xsl:with-param name="wfs_output.dita" select="$wfs_output.dita"/>
+                        <xsl:with-param name="xpath" select="$xpath"/>
+                        <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
+                        <xsl:with-param name="featureID_name" select="$featureID_name"/>
+                        <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
+                        <xsl:with-param name="RelatedFeatureCount" select="$RelatedFeatureCount"/>
+                        <xsl:with-param name="RelatedFeaturePos" select="$RelatedFeaturePos"/>
+                        <xsl:with-param name="typeName" select="$typeName"/>
+                        <xsl:with-param name="xpath_value" select="$xpath_value"/>
+                        <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+                        <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
+                        <!-\-<xsl:with-param name="loop_xpath_save" select="$loop_xpath_save"/>-\->
+                        <xsl:with-param name="xml_id" select="$xml_id"/>
+                        <!-\-<xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>-\->
+                        <xsl:with-param name="feature_pos"   select="$feature_pos"/>
+                        <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
+                    </xsl:apply-templates>-->
+                    <!-- na koniec przetwarzania kazdego z wezlow, podmieniamy xsl biezacy wezel -->
+                    <xsl:comment>template  match="RelatedFeature" mode="after_first_ant_assing_vars_childs" 
+                                robi result-document href="build_{$loop_xpath}.{$uuid}.xml
+                               wiec powinnismy uruchomic ant ten plik w ciemno znajac jego nizsze wezly</xsl:comment>
+                    <xsl:variable name="featureID_name_child" select="substring-after($typeName,':')"/>
+                    <xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
+                    <xsl:message>#142 ustalamy $loop_xpath_child=<xsl:value-of select="$loop_xpath_child"/></xsl:message>
+                    
+                    <!-- warunek dla ograniczenia zapetlenia TODO do optymalizacji aby nie potrzebnie nie robilo zapytania czy jest wezel zaglebiony -->
+                    
+                    <xsl:element name="target">
+                        <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_check')"/>
+                        <!--<tempfile property="test_child_curl_ouptut.xml"/>--> <!-- todo deleteonexit=yes -->
+                        <xsl:element name="tempfile">
+                            <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_temp')" />
+                            <xsl:attribute name="destdir" select="$temp"/>
+                        </xsl:element>
+                        <xsl:variable name="OGC_Filter">
+                            <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
+                                <xsl:with-param name="simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
+                                <xsl:with-param name="RelatedFilter" select="RelatedFilter"/>
+                                <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
+                                <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
+                            </xsl:call-template>
+                        </xsl:variable>
+                        <xsl:variable name="url">
+                            <xsl:value-of select="$api_url"/>/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=<xsl:value-of select="$typeName_dita"/>&amp;SRSNAME=EPSG:3003<xsl:value-of select="$OGC_Filter"/>
+                        </xsl:variable>
+                        <xsl:element name="exec">
+                            <xsl:attribute name="executable" select="'curl'"/>
+                            <xsl:attribute name="output" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
+                            <xsl:element name="arg">
+                                <xsl:attribute name="line"> <xsl:value-of select="$cookie_curl_option"/> "<xsl:value-of select="$url"/>"</xsl:attribute>
+                            </xsl:element>
+                        </xsl:element>
+                        <xsl:element name="loadfile">
+                            <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_msg')"/>
+                            <xsl:attribute name="srcFile" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')" />
+                        </xsl:element>
+                        <echo> $msg ${<xsl:value-of select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_msg')"/>} </echo>
+                        <xsl:element name="condition">
+                            <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_test')"/>
+                            <xsl:attribute name="taskname" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs)"/>
+                                <xsl:element name="contains">
+                                    <xsl:attribute name="string" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_msg}')"/>
+                                    <xsl:attribute name="substring" select="'featureMember'"/>
+                                </xsl:element>
+                        </xsl:element>
+                    </xsl:element>
+                    <!--<target name="check_if_child">
+                        <exec executable="curl"
+                            output="/Users/a.binder/Documents/biuro.biall-net.pl-gitlab-se-2015-02-16.git/SE/schema/ant-url_action/default_db.crm_proces/CRM_PROCES_tree/temp/d3e16/prezes1.root_x2f_.d3e1.CRM_PROCES_x2f_.d3e21.CRM_PROCES.1.1.xml_exists"
+                            errorproperty="wfs_error"
+                            resultproperty="wfs_result">
+                            <arg line=" -b /Users/a.binder/Documents/biuro.biall-net.pl-gitlab-se-2015-02-16.git/SE/schema/ant-url_action/default_db.crm_proces/CRM_PROCES_tree/temp/prezes1.cookie &#34;https://biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=p5_default_db:CRM_PROCES&amp;SRSNAME=EPSG:3003&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;IID&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;995&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;&lt;ogc:Or&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;TYPE&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;PROCES&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;&lt;/ogc:Or&gt;&lt;/ogc:And&gt;&lt;/ogc:Filter&gt;&#34;"/>
+                        </exec>
+                        
+                        <loadfile property="msg" srcFile="/Users/a.binder/Documents/biuro.biall-net.pl-gitlab-se-2015-02-16.git/SE/schema/ant-url_action/default_db.crm_proces/CRM_PROCES_tree/temp/d3e16/prezes1.root_x2f_.d3e1.CRM_PROCES_x2f_.d3e21.CRM_PROCES.1.1.xml_exists" />
+                        <echo> MSG to ${msg} </echo>
+                        <condition property="test" taskname="get_related_feature_run_child_antroot_x2f_.d3e1.CRM_PROCES_x2f_.d3e16.CRM_PROCES_/d3e16" >
+                            <contains string="${msg}" substring="featureMember"/>
+                        </condition>
+                        
+                    </target>-->
+                    
+                    <xsl:element name="target">
+                        <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs)"/>
+                        <xsl:attribute name="depends" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_check')"/>
+                        <xsl:attribute name="if" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_test}')"/>
+                        <!--<xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos,$loop_xpath_real,'_',$loop_path_recurs)"/>-->
+                        <!--<xsl:choose>
+                        <xsl:when test=".//(RelatedFeature|RelatedFeatureRoot)">
+                            <xsl:for-each select=".//RelatedFeature[ not(child::node()/name()='RelatedFeature')]">
+                                <xsl:variable name="loop_xpath_child_ant" select="concat($loop_xpath_save,'_x2f_.',@xml_id,'.',$featureID_name)"/>
+                                <xsl:message>#148 ustalamy $loop_xpath_child_ant=<xsl:value-of select="$loop_xpath_child_ant"/></xsl:message>
+                               <!-\- <xsl:element name="target">
+                                    <xsl:attribute name="name" select="$loop_xpath_child_ant"/><!-\\-'get_related_feature_run_child_ant'-\\->
+                                    <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>-\->
+                                <!-\-<ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.xml" dir="."/>-\->
+                                <ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>
+                                
+                                <!-\-</xsl:element>-\->
+                                <xsl:if test=" position()=last()">
+                                    <xsl:comment>Tu task z related</xsl:comment>
+                                </xsl:if>
+                            </xsl:for-each>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:comment>#135 nie ma wiecej //RelatedFeature</xsl:comment>
+                            <!-\-<xsl:element name="target">
+                                <xsl:attribute name="name" select="'get_related_feature_run_child_ant'"/>
+                                <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>
+                            </xsl:element>-\->
+                        </xsl:otherwise>
+                    </xsl:choose>-->
+                        <!-- wstawienie subanta dla biezacych dzieci only -->
+                        <!--<xsl:apply-templates mode="place_subant_RelatedFeatureLoop"> - ten nie potrzebuje generowac subantow - powinien go obsluzyc glowny
+                            <xsl:with-param name="uuid" select="$uuid"/>
+                            <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+                            <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
+                            <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
+                        </xsl:apply-templates>-->
+                        <ant antfile="{$basedir}/build.xml" target="xml_recursed_from_tr_map"/>
+                    </xsl:element>
+                    <!-- na koniec przetwarzania danego zaglebienia uruchamiamy calosc ponownie do kolejnego zaglebienia -->
+                    <!-- task do polaczenia zaglebien -->
+                    <!-- jak nie ma zaglebien to generujemy pdf i dajemy uzytkownikowi linka  -->
+                </project>
+            </xsl:when>
             <xsl:otherwise>
                 <xsl:apply-templates mode="child_nodes"/>
             </xsl:otherwise>
@@ -262,21 +517,23 @@
         <xsl:copy-of select="."/>
     </xsl:template>
     
+    <!--<xsl:template mode="child_nodes" match="simpleTypeMakeOgcFilter">
+        <xsl:message>#266 bypassing temporary simpleTypeMakeOgcFilter of problem with output </xsl:message>
+    </xsl:template>-->
+    
     <xsl:template mode="place_subant" match="RelatedFeature">
         <xsl:param name="uuid" required="yes"/>
         <xsl:param name="loop_xpath" required="yes"/>
         <xsl:param name="loop_xpath_real" required="yes"/>
         <!-- wygenerujemy liste ant -->
-        
         <echo> #235 ant szukam fileset id=builds_to_ant w <xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.*.xml')"/> </echo>
-        <fileset id="builds_to_ant{$loop_xpath_real}{@xml_id}" dir="temp" includes="{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.*.xml" />
-        
+        <fileset id="builds_to_ant{$loop_xpath_real}{@xml_id}" dir="{$temp}" includes="{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.*.xml" />
         <property name="builds_to_ant{$loop_xpath_real}{@xml_id}" refid="builds_to_ant{$loop_xpath_real}{@xml_id}"/>
         <!--<tempfile property="builds_to_ant.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.builds_to_ant-"/>-->
         <xsl:element name="tempfile">
             <xsl:attribute name="property" select="concat('builds_to_ant.xml',$loop_xpath_real,@xml_id)"/>
             <xsl:attribute name="deleteonexit" select="'no'"/>
-            <xsl:attribute name="destdir" select="'temp'"/>
+            <xsl:attribute name="destdir" select="$temp"/>
             <xsl:attribute name="suffix" select="'.xml'"/>
             <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-',@xml_id,'-')"/>
         </xsl:element>
@@ -284,7 +541,7 @@
         <xsl:element name="tempfile">
             <xsl:attribute name="property" select="concat('builds_to_ant_file.xml',$loop_xpath_real,@xml_id)"/>
             <xsl:attribute name="deleteonexit" select="'no'"/>
-            <xsl:attribute name="destdir" select="'temp'"/>
+            <xsl:attribute name="destdir" select="$temp"/>
             <xsl:attribute name="suffix" select="'.xml'"/>
             <xsl:attribute name="prefix" select="concat('${uuid}.build_to_ant_file-',@xml_id,'-')"/>
         </xsl:element>
@@ -305,7 +562,6 @@
                 <!--<attribute name="http://saxon.sf.net/feature/initialMode"
                value="after_first_ant_assing_vars"/>-->
             </factory>
-            
             <param name="temp" expression="{$temp}"/>
             <param name="loop_xpath_real" expression="{$loop_xpath_real}{@xml_id}"/>
             <!--<xsl:element name="param">
@@ -315,23 +571,54 @@
             <param name="default_antfile" expression="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xsl:element>
-        
         <!--<ant antfile="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>-->
-        
         <xsl:element name="ant">
             <xsl:attribute name="antfile" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,@xml_id,'}')"/>
         </xsl:element>
         <!--<ant antfile="{$temp}/${builds_to_ant_file.xml}" dir="."/>-->
-        
     </xsl:template>
+   
+    <xsl:template mode="place_subant" match="RelatedFeatureLoop">
+        <xsl:param name="uuid" required="yes"/>
+        <xsl:param name="loop_xpath" required="yes"/>
+        <xsl:param name="loop_xpath_real" required="yes"/>
+        <xsl:param name="xpath_dita"  required="yes"/>
+        <xsl:param name="xpath_value_dita" required="yes"/>
+        <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
+        <!-- wygenerujemy liste ant -->
+        <echo> #523 RelatedFeatureLoop ant bede odpalac w podkatalogu:@xml_id=(<xsl:value-of select="@xml_id"/>) 
+            <xsl:value-of select="concat($temp,'/',@xml_id,'/',$uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/> </echo>
+        <xsl:message>#591 todo executing by exec instead of ant without inheritAll because it's looping!!! </xsl:message>
+        <exec command="/opt/local/bin/ant" dir="{$temp}" failifexecutionfails="true">
+            <!--<arg line="-f ${builds_to_ant_file.xml}"/>-->
+            <xsl:element name="arg">
+                <xsl:attribute name="line" select="concat('-f ',@xml_id,'/',$uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/>
+            </xsl:element>
+        </exec>
+        <!--<xsl:element name="ant">
+            <xsl:attribute name="antfile" select="concat($temp,'/',@xml_id,'/',$uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/>
+            <xsl:attribute name="inheritAll" select="'false'"/>
+            <xsl:attribute name="inheritRefs" select="'false'"/>
+            <property name="xpath" value="{$xpath_dita}"/>
+            <property name="xpath_value_dita" value="{$xpath_value_dita}"/>
+        </xsl:element>-->
+        <!--<ant antfile="{$temp}/${builds_to_ant_file.xml}" dir="."/>-->
+    </xsl:template>
+   
     <xsl:template mode="place_subant" match="*">
         <xsl:param name="uuid" required="yes"/>
         <xsl:param name="loop_xpath" required="yes"/>
         <xsl:param name="loop_xpath_real" required="yes"/>
+        <xsl:param name="xpath_dita"  required="yes"/>
+        <xsl:param name="xpath_value_dita" required="yes"/>
+        <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
         <xsl:apply-templates mode="place_subant">
             <xsl:with-param name="uuid" select="$uuid"/>
             <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
             <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
+            <xsl:with-param name="xpath_dita"  select="$xpath_dita"/>
+            <xsl:with-param name="xpath_value_dita"  select="$xpath_value_dita"/>
+            <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
         </xsl:apply-templates>
     </xsl:template>
     <xsl:template mode="place_subant" match="text()|comment()"/>
@@ -398,20 +685,25 @@
     -->
              <!-- sprawdzamy czy template pasuje do zadania wyzwolenia czy xpath=xpath_dita oraz czy typeName=typeName_dita-->
              <xsl:choose>
-                 <xsl:when test="string($xpath_dita)= string($xpath) and string($featureID_name)=string($featureID_name_dita)">
+                 <xsl:when test="string($featureID_name)=string($featureID_name_dita)"> <!-- bylo string($xpath_dita)= string($xpath)  - ale nie jest to konieczne przy recurse ! - jest to bledne zalozenie  -->
                      <!-- calculate query to api default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:IN7_DZIENNIK_KORESP&SRSNAME=EPSG:3003&featureID=IN7_DZIENNIK_KORESP.1000'-->
                      <!--<property name="OGC_Filter">%26lt;ogc:Filter%26gt;%26lt;ogc:PropertyIsNull%26gt;%26lt;ogc:PropertyName%26gt;the_geom%26lt;/ogc:PropertyName%26gt;%26lt;/ogc:PropertyIsNull%26gt;%26lt;/ogc:Filter%26gt;</property>-->
-                     
                      <!--<xsl:variable name="OGC_Filter">&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;&lt;/ogc:Filter&gt;</xsl:variable>-->
-                     
-                     
+                     <!--<xsl:variable name="OGC_Filter">
+                        <xsl:choose>
+                                <xsl:when test="RelatedFilter"><xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="RelatedFilter" copy-namespaces="no"/></xsl:message>&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;<xsl:for-each select="RelatedFilter">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="@xpath"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="@xpath_value"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:And&gt;&lt;/ogc:Filter&gt;</xsl:when>
+                                <xsl:otherwise>&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;&lt;/ogc:Filter&gt;</xsl:otherwise>
+                            </xsl:choose>
+                     </xsl:variable>-->
                      <xsl:variable name="OGC_Filter">
-                         <xsl:choose>
-                             <xsl:when test="RelatedFilter"><xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="RelatedFilter" copy-namespaces="no"/></xsl:message>&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;<xsl:for-each select="RelatedFilter">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="@xpath"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="@xpath_value"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:And&gt;&lt;/ogc:Filter&gt;</xsl:when>
-                             <xsl:otherwise>&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;&lt;/ogc:Filter&gt;</xsl:otherwise>
-                         </xsl:choose>
+                         <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
+                             <xsl:with-param name="simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
+                             <xsl:with-param name="RelatedFilter" select="RelatedFilter"/>
+                             <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
+                             <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
+                         </xsl:call-template>
                      </xsl:variable>
-                     <xsl:message>#410 final OGC_Filter is <xsl:value-of select="$OGC_Filter"/>; </xsl:message>
+                     <xsl:message>#410 final OGC_Filter is <xsl:value-of select="$OGC_Filter"/>;</xsl:message>
                      <xsl:variable name="url">
                          <!--<xsl:value-of select="$api_url"/>/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=<xsl:value-of select="$typeName_dita"/>&amp;SRSNAME=EPSG:3003&amp;featureID=<xsl:value-of select="$featureID_name_dita"/>.<xsl:value-of select="$xpath_value_dita"/>-->
                          <xsl:value-of select="$api_url"/>/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=<xsl:value-of select="$typeName_dita"/>&amp;SRSNAME=EPSG:3003<xsl:value-of select="$OGC_Filter"/>
@@ -424,12 +716,11 @@
                                         <xsl:attribute name="depends" select="concat('get_related_feature.',position()-1),$loop_xpath_real"/>
                                     </xsl:otherwise>
                                 </xsl:choose>
-                                
                                 <!--<tempfile property="out_task.dita" deleteonexit="no"  destdir="temp"/>-->
                                     <!--<tempfile property="wfs_output" deleteonexit="no"  destdir="temp"  suffix=".xml" />-->
                                     <xsl:element name="exec">
                                         <xsl:attribute name="executable" select="'curl'"/>
-                                        <xsl:attribute name="output"  select="concat('temp/',$wfs_output.xml)"/>
+                                        <xsl:attribute name="output"  select="concat($temp,'/',$wfs_output.xml)"/>
                                         <xsl:attribute name="errorproperty" select="'wfs_error'"/>
                                         <xsl:attribute name="resultproperty" select="'wfs_result'"/>
                                         <xsl:element name="arg">
@@ -451,16 +742,17 @@
                                             <antcall target="build_recurse_ant.{position()+1}.xml"/>
                                         </xsl:otherwise>
                                     </xsl:choose>
-                                    <echo> related .dita.xml template is: $wfs_output.dita=<xsl:value-of select="$wfs_output.dita"/>; do przetwarzania na podstawie: $wfs_output.xml=<xsl:value-of select="$wfs_output.xml"/>;</echo>
+                                    <echo> related .dita.xml template is: $wfs_output.dita=<xsl:value-of select="$wfs_output.dita"/>; do przetwarzania na podstawie: $wfs_output.xml=<xsl:value-of select="$wfs_output.xml"/>;
+                                            $temp is <xsl:value-of select="$temp"/>;</echo>
                                     <xsl:comment> teraz podmieniamy dane z otrzymanego xmla do pliku dita aby potem zrobic polaczony plik  w kolejnym wyzwoleniu ant</xsl:comment>
-                                    <delete file="temp/{$wfs_output.dita}.vals.dita"/>
-                                    <xslt basedir="./" style="{$build_recurse_ant.xsl}" in="temp/{$wfs_output.dita}"  destdir="./" out="temp/{$wfs_output.dita}.vals.dita" >
+                                    <delete file="{$temp}/{$wfs_output.dita}.vals.dita"/>
+                                    <xslt basedir="./" style="{$build_recurse_ant.xsl}" in="{$temp}/{$wfs_output.dita}"  destdir="./" out="{$temp}/{$wfs_output.dita}.vals.dita" >
                                             <factory name="net.sf.saxon.TransformerFactoryImpl">    
                                                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
                                                 <attribute name="http://saxon.sf.net/feature/initialMode" value="after_first_ant_assing_vars"/>
                                             </factory>
                                             <classpath location="/opt/local/share/java/saxon9he.jar"/>
-                                            <param name="wfs_output" expression="{$basedir}/temp/{$wfs_output.xml}"/>
+                                            <param name="wfs_output" expression="{$temp}/{$wfs_output.xml}"/>
                                             <param name="xpath" expression="{$xpath}" /> <!-- kontrolnie - nie potrzebne -->
                                             <param name="xpath_value" expression="{$xpath_value}" /> <!-- kontrolnie - nie potrzebne -->
                                             <param name="loop_xpath" expression="{$loop_xpath}"/>
@@ -476,6 +768,7 @@
                                             <param name="builds_to_ant.xsl" expression="{$builds_to_ant.xsl}"/>
                                             <param name="cookie_curl_option" expression="{$cookie_curl_option}"/>
                                             <param name="api_url" expression="{$api_url}"/>
+                                            <param name="loop_path_recurs" expression="{$loop_path_recurs}"/>
                                     </xslt>
                             </xsl:element>
                         <!-- zapisujemy wynik naszego biezacego przetwarzania dita element nizej do kolejnego przejechania z ant wyniku dla podstawienia danych  -->
@@ -514,8 +807,7 @@
                          <xsl:attribute name="featureID_name_dita" select="$featureID_name_dita"/>
                          <echo message="OUTPUT__START"/>
                                 <echo>
-                                    Current template doesnt fit the requested data - TODO search for another template! string($xpath_dita)(<xsl:value-of select="$xpath_dita"/>)= string($xpath)(<xsl:value-of select="$xpath"/>) and string($featureID_name)(<xsl:value-of select="$featureID_name"/>)=string($featureID_name_dita)(<xsl:value-of select="$featureID_name_dita"/>)
-                                    
+                                    Current template doesnt fit the requested data - TODO search for another template! string($xpath_dita)(<xsl:value-of select="$xpath_dita"/>) != string($xpath)(<xsl:value-of select="$xpath"/>) and string($featureID_name)(<xsl:value-of select="$featureID_name"/>) !=string($featureID_name_dita)(<xsl:value-of select="$featureID_name_dita"/>)
                                 </echo>
                          <echo message="OUTPUT__END"/>
                      </error>
@@ -525,9 +817,14 @@
     
     
     
-    <!-- second step from local ant leaf -->
     
+    <xsl:template name="simpleTypeMakeOgcFilter_merge"><!-- do zrobienia polaczonego filtru OGC -->
+        <xsl:param name="simpleTypeMakeOgcFilter" required="yes"/>
+        <xsl:param name="xpath_dita" required="yes"/>
+        <xsl:param name="xpath_value_dita" required="yes"/>
+        <xsl:param name="RelatedFilter"/>&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;<xsl:choose><xsl:when test="RelatedFilter"><xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="RelatedFilter" copy-namespaces="no"/></xsl:message>&lt;ogc:And&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;<xsl:for-each select="RelatedFilter">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="@xpath"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="@xpath_value"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:And&gt;</xsl:when><xsl:otherwise>&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:otherwise></xsl:choose><xsl:if test="$simpleTypeMakeOgcFilter">&lt;ogc:Or&gt;<xsl:for-each select="$simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="ogc:PropertyName/text()"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="ogc:Literal/text()"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:Or&gt;</xsl:if>&lt;/ogc:And&gt;&lt;/ogc:Filter&gt;</xsl:template>
     
+    <!-- second step from local ant leaf -->
     <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
         <xsl:param name="loop_xpath" select="$loop_xpath"/>
         <RelatedFeatureRoot>
@@ -612,6 +909,12 @@
     
     <xsl:template match="text()" mode="after_first_ant_assing_xpath"/>
     
+    
+    <xsl:template  match="simpleTypeMakeOgcFilter" mode="after_first_ant_assing_vars_childs">
+        <xsl:message>#621 bypassing simpleTypeMakeOgcFilter in after_first_ant_assing_vars_childs</xsl:message>
+    </xsl:template>
+    
+    
     <!-- przetwarzanie kolejne w celu podstawienia wartosci i wystawienia build dla kolejnych wezlow - problem z obsluga rownorzednie zagniezdzonych wezlow poprzez inne wezly -->
     <xsl:template  match="*" mode="after_first_ant_assing_vars_childs">
         <xsl:param name="xml_id_parent" required="yes"/>
@@ -717,8 +1020,7 @@
             </xsl:choose>
         </xsl:variable>-->
         <xsl:message>#389  jest okazja do zrobienia bilda $feature_pos=<xsl:value-of select="$feature_pos"/> $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>;  result-document=<xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'.xml')"/> match=RelatedFeature mode=after_first_ant_assing_vars_childs  </xsl:message>
-            
-        <xsl:result-document href="{$uuid}.build_{$loop_xpath}.{$feature_pos}.xml">
+        <xsl:result-document href="{$temp}/{$uuid}.build_{$loop_xpath}.{$feature_pos}.xml">
             <xsl:apply-templates select=".">
                 <xsl:with-param name="typeName" select="@typeName"/>
                 <xsl:with-param name="xpath" select="@xpath"/>
@@ -729,6 +1031,7 @@
                 <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
                 <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
                 <xsl:with-param name="feature_pos"   select="$feature_pos"/>
+                <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
                 <!--<xsl:with-param name="wfs_output.xml" />-->
             </xsl:apply-templates>
         </xsl:result-document>
@@ -737,18 +1040,65 @@
             <xsl:attribute name="featureID_name" select="$featureID_name"/>
             <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
         </xsl:element>
-        
     </xsl:template>
     
     
+    <xsl:template  match="RelatedFeatureLoop" mode="after_first_ant_assing_vars_childs">
+        <xsl:param name="input_obj_with_xpath" required="yes"/>
+        <xsl:param name="xml_id_parent" required="yes"/>
+        <xsl:param name="loop_xpath"  select="$loop_xpath"/>
+        <xsl:param name="feature_pos"   required="yes"/>
+        <xsl:message>#411-817 $feature_pos=<xsl:value-of select="$feature_pos"/>; mode after_first_ant_assing_vars_childs bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message>
+        <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
+        <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
+        <xsl:variable name="xml_id" select="@xml_id"/>
+        <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
+        <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
+        <!--<debug_358_RelatedFeature>
+            <xsl:copy-of select="$input_obj_with_xpath"/>
+        </debug_358_RelatedFeature>-->
+        <!--<xsl:variable name="feature_pos">
+            <xsl:choose>
+                <xsl:when test="$feature_pos=1"/>
+                <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>-->
+        <xsl:message>#832 RelatedFeatureLoop  jest okazja do zrobienia bilda $feature_pos=<xsl:value-of select="$feature_pos"/> $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>;  result-document=<xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'.xml')"/> match=RelatedFeature mode=after_first_ant_assing_vars_childs  </xsl:message>
+        <xsl:variable name="loop_path_recurs">
+            <xsl:choose>
+                <xsl:when test=" string-length($loop_path_recurs) &lt;1">
+                    <xsl:value-of select="concat('/',@xml_id)"/>
+                </xsl:when>
+                <xsl:otherwise><xsl:value-of select="concat($loop_path_recurs,'/',@xml_id)"/></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:result-document href="{$temp}/{@xml_id}/{$uuid}.build_{$loop_xpath}.{$feature_pos}.xml" >
+            <xsl:apply-templates select=".">
+                <xsl:with-param name="typeName" select="@typeName"/>
+                <xsl:with-param name="xpath" select="@xpath"/>
+                <xsl:with-param name="xpath_value" select="@xpath_value"/>
+                <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
+                <xsl:with-param name="input_obj_with_xpath"  select="$input_obj_with_xpath"/>
+                <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+                <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
+                <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
+                <xsl:with-param name="feature_pos"   select="$feature_pos"/>
+                <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
+                <!--<xsl:with-param name="wfs_output.xml" />-->
+            </xsl:apply-templates>
+        </xsl:result-document>
+        <xsl:element name="RelatedFeature">
+            <xsl:copy-of select="@*"/>
+            <xsl:attribute name="featureID_name" select="$featureID_name"/>
+            <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
+        </xsl:element>
+    </xsl:template>
+    
     <xsl:template match="text()" mode="after_first_ant_assing_vars_childs"/>
     <xsl:template match="comment()" mode="after_first_ant_assing_vars_childs"/>
     <!-- pozbieranie do kupy wszystkich xmli i zlozenie dity -->
     
     
-    
-    
-    
     <xsl:template match="*" mode="enter_to_ph">
         <xsl:param name="count"/>
         <xsl:param name="element"/>

+ 24 - 5
SE/schema/default_db_xml_cache.public/build_recurse_ant_merge_dita_from_temp.xsl

@@ -6,6 +6,7 @@
     xmlns:wfs="http://www.opengis.net/wfs"
     xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
     xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:ogc="http://www.opengis.net/ogc"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -14,7 +15,7 @@
     <xsl:strip-space elements="*"/>
     
     <xsl:param name="uuid" required="yes"/>
-    <xsl:param name="basedir" required="yes"/>
+    <!--<xsl:param name="basedir" required="yes"/>-->
     <xsl:param name="temp" required="yes"/>
     
     <!-- template do zlaczenia wszystkich xmli z danymi z dita 
@@ -47,6 +48,7 @@
         </xsl:element>
     </xsl:template>
     
+    
     <xsl:template match="RelatedFilter">
         <xsl:message>#55 bypasing RelatedFilter output <xsl:copy-of select="."/></xsl:message>
     </xsl:template>
@@ -56,6 +58,22 @@
     <xsl:template match="RelatedFilter" mode="root">
         <xsl:message>#61 bypasing RelatedFilter output <xsl:copy-of select="."/></xsl:message>
     </xsl:template>
+   
+   
+   
+    <xsl:template match="simpleTypeMakeOgcFilter">
+        <xsl:message>#63 bypasing simpleTypeMakeOgcFilter output <xsl:copy-of select="."/></xsl:message>
+    </xsl:template>
+    <xsl:template match="simpleTypeMakeOgcFilter" mode="root">
+        <xsl:message>#66 bypasing simpleTypeMakeOgcFilter output <xsl:copy-of select="."/></xsl:message>
+    </xsl:template>
+    <xsl:template match="simpleTypeMakeOgcFilter" mode="RelatedFeatureChild">
+        <xsl:message>#69 bypasing simpleTypeMakeOgcFilter output <xsl:copy-of select="."/></xsl:message>
+    </xsl:template>
+    <xsl:template match="simpleTypeMakeOgcFilter" mode="RelatedFeature">
+        <xsl:message>#71 bypasing simpleTypeMakeOgcFilter output <xsl:copy-of select="."/></xsl:message>
+    </xsl:template>
+    
     
     <xsl:template match="RelatedFeature">
         <!-- podstawamy dane z xml na podstawie path -->
@@ -75,12 +93,13 @@
         
         <xsl:variable name="dita_fragment">
             <xsl:choose>
-                <xsl:when test=" doc-available(concat($basedir,'/',$temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))">
-                    <xsl:copy-of select="doc(concat($basedir,'/',$temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))"/>
+                <xsl:when test=" doc-available(concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))">
+                    <xsl:message>#97 INFO Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/></xsl:message>
+                    <xsl:copy-of select="doc(concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita'))"/>
                 </xsl:when>
                 <xsl:otherwise>
-                    <xsl:comment>#78 INFO no Related leaf xml file <xsl:value-of select="concat($basedir,'/temp/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/>;</xsl:comment>
-                    <xsl:message>#78 INFO no Related leaf xml file <xsl:value-of select="concat($basedir,'/temp/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/></xsl:message>
+                    <xsl:comment>#78 INFO no Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/>;</xsl:comment>
+                    <xsl:message>#78 INFO no Related leaf xml file <xsl:value-of select="concat($temp,'/',$uuid,'.',$loop_xpath,'.',$RelatedFeaturePos,'.',$feature_pos_child,'.dita.xml.vals.dita')"/></xsl:message>
                 </xsl:otherwise>
             </xsl:choose>
         </xsl:variable>

+ 14 - 14
SE/schema/default_db_xml_cache.public/main_build_recurse_ant.dita_with_id.xsl

@@ -120,7 +120,7 @@
         <!--<xsl:param name="build_complexType" required="yes"/>< - tutaj tworzymy kolejne lokalne build_complexType-->
         <xsl:variable name="build_complexType" select="doc(concat($build_complexType_dir,'/element-',system_cache__appinfo:escape_object_prefix_to_string(@system_cache__appinfo:ref),'.xml'))"/>
         <xsl:variable name="detect_resource_type" select=" system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type_from_cache(@system_cache__appinfo:ref)"/>
-        <RelatedFeature>
+        <xsl:element name="RelatedFeature">
             <xsl:attribute name="xml_id" select="generate-id()"/>
                  <!-- tymczasowe wymuszenie relacji do obiektu glownego na podstawie $detect_resource_type -->
                  <!--<xsl:attribute name="typeName" select="p5_tr_map:force_local_typeName(@system_cache__appinfo:ref)"/>-->
@@ -139,31 +139,31 @@
                   <xsl:attribute name="xml_id" select="generate-id()"/>
                     <xsl:message>#125 try to name element <xsl:value-of select="concat($namespace_prefix,':',$detect_resource_type//system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type/@system_cache__appinfo:get_default_db_obj_url_table_name)"/>; </xsl:message>
                 <xsl:apply-templates mode="p5_tr_map:go_recurse_from_root_by_build_element_477_backref" select="."/>
-                 <!--<xsl:comment> #73 to check instances tables:
-                     <xsl:copy-of select="$detect_resource_type/system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_objects_parent_relations/
-                         system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type/p5_tr_map:objects_derivations_list"/>
-                 </xsl:comment>-->
-                 <!--<prefixed_object_info>
-                     <xsl:copy-of select="$detect_resource_type"/>
-                 </prefixed_object_info>-->
+                                     <!--<xsl:comment> #73 to check instances tables:
+                                         <xsl:copy-of select="$detect_resource_type/system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_objects_parent_relations/
+                                             system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type/p5_tr_map:objects_derivations_list"/>
+                                     </xsl:comment>-->
+                                     <!--<prefixed_object_info>
+                                         <xsl:copy-of select="$detect_resource_type"/>
+                                     </prefixed_object_info>-->
                 <xsl:call-template name="p5_tr_map:simpleTypeMakeOgcFilter">
                     <xsl:with-param name="build_complexType" select="$build_complexType"/>
                 </xsl:call-template>
                 <xsl:element name="{concat($namespace_prefix,':',$detect_resource_type//system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type/@system_cache__appinfo:get_default_db_obj_url_table_name)}">
-                    <xsl:attribute name="xml_id" select="generate-id()"/>
+                    <xsl:attribute name="xml_id" select="concat(generate-id(),'_child')"/>
                     <xsl:apply-templates mode="p5_tr_map:go_recurse_from_root_by_build_element_477_attrs" select="@*"/>
                     <xsl:apply-templates>
                         <xsl:with-param name="build_complexType" select="$build_complexType"/>
                     </xsl:apply-templates>
                 </xsl:element>
-        </RelatedFeature>
+        </xsl:element>
     </xsl:template>
     
     <xsl:template match="p5_tr_map:go_recurse_from_root_by_build_element_477[@system_cache__appinfo:loop_name]">
         <!--<xsl:param name="build_complexType" required="yes"/>-->
         <xsl:variable name="build_complexType" select="doc(concat($build_complexType_dir,'/element-',system_cache__appinfo:escape_object_prefix_to_string(@system_cache__appinfo:ref),'.xml'))"/><!-- tutaj na podstawie tego powinnismy zbudowac odpowiedni filtr lub olac? o to zadba kolejne wyzwolenie rekursywne-->
         <xsl:variable name="detect_resource_type" select=" system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type_from_cache(@system_cache__appinfo:ref)"/> 
-        <RelatedFeatureLoop>
+        <xsl:element name="RelatedFeatureLoop">
             <xsl:attribute name="xml_id" select="generate-id()"/>
             <!-- tymczasowe wymuszenie relacji do obiektu glownego na podstawie $detect_resource_type -->
             <!--<xsl:attribute name="typeName" select="p5_tr_map:force_local_typeName(@system_cache__appinfo:ref)"/>-->
@@ -197,7 +197,7 @@
                 <xsl:apply-templates mode="p5_tr_map:go_recurse_from_root_by_build_element_477_attrs" select="@*"/>
                 <!--<xsl:apply-templates/>-->
             </xsl:element>
-        </RelatedFeatureLoop>
+        </xsl:element>
     </xsl:template>
     
     <xsl:template mode="p5_tr_map:go_recurse_from_root_by_build_element_477_backref" match="*">
@@ -317,9 +317,9 @@
     </xsl:template>
     
     <xsl:template mode="p5_tr_map:simpleTypeMakeOgcFilter" match="sequence|complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
-        <xsl:element name="{name()}">
+        <!--<xsl:element name="{name()}">-->
             <xsl:apply-templates mode="p5_tr_map:simpleTypeMakeOgcFilter"/>
-        </xsl:element>
+        <!--</xsl:element>-->
     </xsl:template>
     
     <xsl:template mode="p5_tr_map:simpleTypeMakeOgcFilter" match="element[not(@ref)]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">