build_recurse_ant.xsl 187 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:gml="http://www.opengis.net/gml"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xmlns:xlink="http://www.w3.org/1999/xlink"
  7. xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
  8. xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
  9. xmlns:wfs="http://www.opengis.net/wfs"
  10. xmlns:ogc="http://www.opengis.net/ogc"
  11. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  12. xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
  13. exclude-result-prefixes="xs"
  14. version="2.0">
  15. <xsl:output indent="yes" />
  16. <xsl:strip-space elements="*"/>
  17. <!-- Copyright BIALL-NET sp. z o.o. 2017-03-01 by Arkadiusz Binder wszelkie prawa zastrzeżone -->
  18. <!-- @2017-03-01 modyfikacja dla potrzeb CRM_PROCES_tree - sa bledy-->
  19. <!--<xsl:include href="escaped_html_to_xml.xsl"/>-->
  20. <!--
  21. <property name="url" value="${url}"/> - to point what is record/table to download
  22. <property name="uuid" value="${uuid}"/> it is automatically also set to enable uinque transaction and to allow to save data with user
  23. <property name="passwordBase64Basic" value="${passwordBase64Basic}"/> - this is also set - to enable communicate with API -
  24. <property name="DwebRootUrl" value="${$webRootUrl}"/> - this is the place where script is localized to easyli to target user GUI by href to generated output -->
  25. <!-- variables to be set first by GUI first_request from executing API (php -> bash)-->
  26. <xsl:param name="uuid" required="yes" /> <!-- pewnie bedziemy ignorowac i dzialac na bazie ${'wfs_output'} ktory juz jest tempfilem -->
  27. <xsl:param name="passwordBase64Basic" required="yes" />
  28. <!--<xsl:param name="url" />-->
  29. <xsl:param name="webRootUrl" />
  30. <xsl:param name="basedir" required="yes"/> <!-- aktualny katalog gdzie znajduja sie pliki temp -->
  31. <xsl:param name="recurse_ant_basedir" required="yes"/> <!-- aktualny katalog gdzie znajduja sie pliki temp -->
  32. <xsl:param name="recurse_ant_basedir.temp" required="yes"/>
  33. <xsl:param name="recurse_ant" required="yes"/> <!-- for <property name="default_db:recurse_ant" value="${default_db:recurse_ant}"/>-->
  34. <!--<xsl:param name="out_task.dita"/>--> <!-- nazwa temp docelowego zrodla do wykonania pliku pdf -->
  35. <!--<xsl:param name="current_leaf.dita" required="yes"/>--> <!-- nazwa aktualnego przetowarzenia .dita - najpierw main_build_recurse_ant.dita potem przechodzi w 1.1.root_x2f_IN7_DZIENNIK_KORESP.1.dita.xml -->
  36. <!--<xsl:param name="wfs_output" select="concat('temp/wfs_output.',$uuid)"/>-->
  37. <!-- jak parametr jest to znaczy, ze przetwarzamy -->
  38. <xsl:param name="wfs_output" required="no"/> <!-- potem wfs_output.xml jak sciagnie nazwa temp sciagniecia z api xml forsowana przez pierwsze sciagniecie -->
  39. <xsl:param name="api_url" required="yes"/>
  40. <!--<xsl:param name="namespace_prefix" select="'p5_default_db'"/>-->
  41. <xsl:param name="typeName" required="yes" /> <!-- to be set initially ex: p5_default_db:IN7_DZIENNIK_KORESP -->
  42. <xsl:param name="xpath" required="yes" /> <!-- to be set initially ex: ID -->
  43. <xsl:param name="xpath_value" required="yes" /> <!-- to be set ex: 1000 -->
  44. <xsl:param name="loop_xpath" required="yes"/> <!-- sciezka do zapisywania xmli w przetwarzaniu plikow default root -->
  45. <xsl:param name="loop_xpath_save" required="yes"/> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
  46. <!-- static project variables as default styles.dita/xsl and names-->
  47. <xsl:param name="main_build_recurse_ant.dita" select="'main_build_recurse_ant.dita'"/>
  48. <xsl:param name="xml_id_parent" select="@xml_id"/>
  49. <xsl:param name="build_recurse_ant.xsl" required="yes"/>
  50. <xsl:param name="temp" required="yes"/>
  51. <xsl:param name="builds_to_ant.xsl" required="yes"/>
  52. <xsl:param name="cookie_curl_option" required="yes"/>
  53. <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 -->
  54. <xsl:param name="ignore_maxOccurs_0" select="false()"/>
  55. <xsl:param name="xpath_query"/>
  56. <xsl:param name="xpath_query.xsl" required="yes"/>
  57. <xsl:param name="empty.xml" required="yes"/>
  58. <xsl:param name="simpleSchema_dir" required="yes"/>
  59. <xsl:param name="default_db_xml_cache.public" required="yes"/>
  60. <xsl:param name="ant-launcher.jar"/>
  61. <xsl:param name="loop_path_recurs_xpath"/><!-- todo do querowania filtrem do zbudowania sciezka obiektu xpath -->
  62. <xsl:param name="build_check_java_process_count.xml" required="yes"/>
  63. <xsl:param name="parallel_java_process_max" required="yes"/>
  64. <xsl:param name="feature_pos" select="1"/> <!-- TODO DEBUG TESTING from PARALLER -->
  65. <xsl:param name="parallel_pos" required="yes"/>
  66. <xsl:param name="debug_xsl_in_filename" required="yes" /> <!-- TODO DEBUG TESTING -->
  67. <xsl:param name="process_locks"/>
  68. <xsl:param name="get_wfs" required="yes"/>
  69. <xsl:param name="debug_xsl_out_filename" required="yes" />
  70. <xsl:param name="debug" select="1"/>
  71. <!--<xsl:variable name="temp_current">
  72. <xsl:choose>
  73. <xsl:when test="$temp='temp'">
  74. <xsl:value-of select="concat($recurse_ant_basedir,'/',$temp)"/>
  75. </xsl:when>
  76. <xsl:otherwise>
  77. <xsl:value-of select="concat('temp/',$loop_path_recurs)"/>
  78. </xsl:otherwise>
  79. </xsl:choose>
  80. </xsl:variable>-->
  81. <!-- second step fist loop - with data -->
  82. <!--<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 -->
  83. <!-- opis dzialania template dla przetwarzania wezlow na podstawie schematu i budowania zagniezdzonego pliku xml z
  84. instancjami na podstawie tego samego schematu
  85. wyzwolenie inicjalizujace z build.xml buduje "wyzwolenie glowne" gdzie na output daje wynikowy build.
  86. system wyzwala dwa etapy
  87. wyzwolenie glowne - do okreslenia zaleznosci wezla i zbudowania zapytania o dane
  88. wyzwolenie after_first_ant_assing_vars - do podstawienia danych z wyzwolenia poprzedniego oraz przygotowania build "dla kolejnego X" do wyzwolenia glownego
  89. wyzwolenie glowne - szuka pierwszego RelatedFeature, ktore zawsze domyslnie jest na poczatku template, potem w nim grzebie - jak znajdzie - wchodzi w dol
  90. w ramach tego wyzwolenia przygotowuje task dla biezecego przygotowania ant_build - mode ant_target
  91. w ramach tego wyzwolenia juz musi przeanalizowac jakie sa dalsze zadania do wyzwolenia "dla kolejnego X' ant_build -
  92. mode place_subant (jest okazja do zrobienia builda) do poprawy zagniezdzenia - co robi na podstawie szukania plikow w kontekscie wyzwolenia after_first_ant_assing_vars
  93. wyzwolenie after_first_ant_assing_vars - to wyzwile
  94. to wyzwolenie podstawia dane do dita.vals.xml w celu zlozenia pliku wyjsciowego
  95. to wyzwolenie powinno juz zrobic ant_buildy "dla kolejnego X'
  96. to wyzwolenie korzysta z apply-templates wyzwolenia glownego, w celu przygotowania ant_build
  97. -->
  98. <xsl:template match="*">
  99. <xsl:param name="typeName" select="$typeName" />
  100. <xsl:param name="xpath" select="$xpath" />
  101. <xsl:param name="xpath_value" select="$xpath_value" />
  102. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  103. <xsl:param name="loop_xpath_save" select="$loop_xpath_save"/><!-- tutaj zapisal sie build z wezla z parent -->
  104. <xsl:param name="input_obj_with_xpath" /> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
  105. <xsl:param name="feature_pos" select="$feature_pos"/> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs"-->
  106. <xsl:param name="loop_path_recurs" select="$loop_path_recurs"/> <!-- przekazany z RelatedFeatureLoop z mode="after_first_ant_assing_vars_childs" -->
  107. <xsl:param name="loop_path_recurs_xpath" select="concat($loop_path_recurs_xpath,'/',@typeName,'[',$feature_pos,']')"/> <!-- todo do querowania filtrem do zbudowania sciezka obiektu xpath -->
  108. <xsl:param name="feature_pos_parent" select="1"/> <!-- @2017-04 bledy z nadpisywaniem dodajemy zapis do przetwarzania na $temp}/{$uuid}.build_{$loop_xpath}.{$feature_pos_parent}.{$feature_pos}.xml -->
  109. <xsl:choose>
  110. <xsl:when test="name()='RelatedFeature'">
  111. <xsl:variable name="RelatedFeatureCount" select="last()"/>
  112. <xsl:variable name="RelatedFeaturePos" select="position()"/> <!-- bylo bug @2017-04 position() -->
  113. <xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
  114. <xsl:if test="$debug &gt; 2"><xsl:message>#58 bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>; $basedir=<xsl:value-of select="$basedir"/>; </xsl:message></xsl:if>
  115. <xsl:variable name="loop_xpath_real" select="$loop_xpath"/>
  116. <xsl:variable name="loop_xpath">
  117. <xsl:choose>
  118. <xsl:when test="$loop_xpath='root'">
  119. <xsl:value-of select="concat(@xml_id,'.',$feature_pos)"/> <!-- limit path out ,'.',$featureID_name - TODO czy tak moze byc dla merge ? @2017-04 bylo concat($loop_xpath,'_x2f_.',@xml_id,'.',$featureID_name) -->
  120. </xsl:when>
  121. <xsl:otherwise><xsl:value-of select="$loop_xpath"/></xsl:otherwise>
  122. </xsl:choose>
  123. </xsl:variable>
  124. <xsl:variable name="typeName_dita" select="@typeName"/>
  125. <xsl:variable name="typeNameRealResource">
  126. <!-- override in case of different real resource by filtered resource -->
  127. <xsl:choose>
  128. <xsl:when test="@typeNameRealResource"><xsl:value-of select="@typeNameRealResource"/></xsl:when>
  129. <xsl:otherwise><xsl:value-of select="$typeName_dita"/></xsl:otherwise>
  130. </xsl:choose>
  131. </xsl:variable>
  132. <xsl:variable name="featureID_name_dita" select="substring-after($typeName_dita,':')"/>
  133. <xsl:variable name="xml_id" select="@xml_id"/>
  134. <!--<xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath,'_x2f_',$featureID_name)"/>-->
  135. <xsl:variable name="wfs_output" select="$loop_xpath"/> <!-- bylo concat($uuid,'.',$loop_xpath) -->
  136. <!--<xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.xml')"/>-->
  137. <xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',$feature_pos_parent,'.',$parallel_pos,'.xml')"/>
  138. <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.dita.xml')"/>
  139. <!--<xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.','.dita.xml')"/>-->
  140. <!-- dane z oczekiwanego template .dita -->
  141. <xsl:variable name="xpath_dita">
  142. <xsl:choose>
  143. <xsl:when test=" string-length($xpath) &gt;0">
  144. <xsl:value-of select="$xpath"/>
  145. <xsl:if test="$debug &gt; 2"><xsl:message>#121 narzucam $xpath=(<xsl:value-of select="$xpath"/>) z wyzwolenia build.xml </xsl:message></xsl:if>
  146. </xsl:when>
  147. <xsl:otherwise><xsl:value-of select="@xpath"/></xsl:otherwise>
  148. </xsl:choose>
  149. </xsl:variable>
  150. <xsl:variable name="xpath_value_dita">
  151. <xsl:choose>
  152. <xsl:when test="@xpath_value">
  153. <!--<xsl:variable name="xpath_value_tokens" select="tokenize(@xpath_value,'/')"/>-->
  154. <!--<xsl:value-of select="'todo zapytanie xpath do przetworzenia'"/>-->
  155. <!--<xsl:copy-of select="$xpath_value_tokens"></xsl:copy-of>-->
  156. <!--<xsl:message>#67 probuje ustalic dla featureID_name=<xsl:value-of select="$featureID_name"/>; wartosc z @xpath_value=<xsl:value-of select="@xpath_value"/>; $input_obj_with_xpath/node()[@xpath="ID_BILLING_OWNER"] =<xsl:value-of select="$input_obj_with_xpath/node()[@xpath='ID_BILLING_OWNER']"/>; </xsl:message>-->
  157. <xsl:if test="$debug &gt; 2"><xsl:message>#67.1 $input_obj_with_xpath: <xsl:copy-of select="$input_obj_with_xpath"/> </xsl:message></xsl:if>
  158. <!--<xsl:variable name="xpath_value_token">-->
  159. <xsl:call-template name="xpath_filter_apply">
  160. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  161. <xsl:with-param name="xpath" select="@xpath"/>
  162. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  163. </xsl:call-template>
  164. <!--</xsl:variable>-->
  165. <!--<xsl:message>#73 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message>-->
  166. <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
  167. <!--<xsl:value-of select="$xpath_value_token"/>-->
  168. </xsl:when>
  169. <xsl:when test="string-length($xpath_value) &gt;0">
  170. <xsl:if test="$debug &gt; 2"><xsl:message>#67.0 $xpath_value=(<xsl:value-of select="$xpath_value"/>); narzucone pewnie z wyzwolenia build.xml</xsl:message></xsl:if>
  171. <xsl:value-of select="$xpath_value"/>
  172. </xsl:when>
  173. <xsl:otherwise>
  174. <xsl:value-of select="$xpath_value"/><!-- parametr z template narzuca wartosc -->
  175. </xsl:otherwise>
  176. </xsl:choose>
  177. </xsl:variable>
  178. <xsl:if test="$debug &gt; 2"><xsl:message>#71 wstawiam projekt $feature_pos=<xsl:value-of select="$feature_pos"/>; $loop_xpath=<xsl:value-of select="$loop_xpath"/>; </xsl:message></xsl:if>
  179. <project basedir="{$recurse_ant_basedir}" name="get_related_feature{$loop_xpath_real}" default="get_related_feature_run_child_ant_if{$loop_xpath_real}">
  180. <!--
  181. get_related_feature_run_child_ant{$loop_xpath_real} - domyslny przed 2017-03-28-->
  182. <!-- get_related_feature_run_child_ant{$loop_xpath_real} -->
  183. <xsl:comment>RelatedFeatureCount:<xsl:value-of select="count(*)"/></xsl:comment>
  184. <xsl:if test="$debug &gt; 1"><echo>
  185. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #197 LEAF RelatedFeature PROJECT BEGIN RUN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  186. | @xml_id is <xsl:value-of select="@xml_id"/> ; $feature_pos_parent is <xsl:value-of select="$feature_pos_parent"/>
  187. | $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/> ;
  188. | $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/> ;
  189. | $typeName_dita = <xsl:value-of select="$typeName_dita"/> ; $typeNameRealResource = <xsl:value-of select="$typeNameRealResource"/> ;
  190. | $xpath_value_dita = <xsl:value-of select="$xpath_value_dita"/>; $xpath_value = <xsl:value-of select="$xpath_value"/>; $xpath_dita = <xsl:value-of select="$xpath_dita"/>;
  191. | $temp is = <xsl:value-of select="$temp"/> ;
  192. | $loop_xpath = <xsl:value-of select="$loop_xpath"/>
  193. | $loop_path_recurs = <xsl:value-of select="$loop_path_recurs"/>
  194. | $feature_pos_parent= <xsl:value-of select="$feature_pos_parent"/>; $feature_pos=<xsl:value-of select="$feature_pos"/>; position()= <xsl:value-of select="position()"/>; $parallel_pos= <xsl:value-of select="$parallel_pos"/> ; ($)parallel_pos= ${parallel_pos}
  195. | $input_obj_fid/@fid = <xsl:value-of select="$input_obj_fid/@fid"/> ;
  196. | ANT Uruchamiam $loop_xpath_real <xsl:value-of select="$loop_xpath_real"/>;
  197. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  198. </echo></xsl:if>
  199. <!--<xsl:variable name="typeName" select='replace($typeName,"&quot;","")'/>--><!-- oczyszczenie z apostrofow -->
  200. <xsl:element name="property">
  201. <xsl:attribute name="name" select="'uuid'"/>
  202. <xsl:attribute name="value" select="$uuid"/>
  203. </xsl:element>
  204. <xsl:element name="property">
  205. <xsl:attribute name="name" select="'passwordBase64Basic'"/>
  206. <xsl:attribute name="value" select="$passwordBase64Basic"/>
  207. </xsl:element>
  208. <xsl:element name="property">
  209. <xsl:attribute name="name" select="'php_session_id'"/>
  210. <xsl:attribute name="value" select="$cookie_curl_option"/>
  211. </xsl:element>
  212. <!--<xsl:element name="property">
  213. <xsl:attribute name="name" select="'url'"/>
  214. <xsl:attribute name="value" select="$url"/>
  215. </xsl:element>-->
  216. <xsl:element name="property">
  217. <xsl:attribute name="name" select="'webRootUrl'"/>
  218. <xsl:attribute name="value" select="$webRootUrl"/>
  219. </xsl:element>
  220. <xsl:element name="property">
  221. <xsl:attribute name="name" select="'build_recurse_ant.xsl'"/>
  222. <xsl:attribute name="value" select="$build_recurse_ant.xsl"/>
  223. </xsl:element>
  224. <xsl:element name="property">
  225. <xsl:attribute name="name" select="'temp'"/>
  226. <xsl:attribute name="value" select="$temp"/>
  227. </xsl:element>
  228. <xsl:element name="property">
  229. <xsl:attribute name="name" select="'builds_to_ant.xsl'"/>
  230. <xsl:attribute name="value" select="$builds_to_ant.xsl"/>
  231. </xsl:element>
  232. <xsl:element name="property">
  233. <xsl:attribute name="name" select="'loop_path_recurs'"/>
  234. <xsl:attribute name="value" select="$loop_path_recurs"/>
  235. </xsl:element>
  236. <xsl:element name="property">
  237. <xsl:attribute name="name" select="'xpath_query'"/>
  238. <xsl:attribute name="value" select="$xpath_query"/>
  239. </xsl:element>
  240. <xsl:element name="property">
  241. <xsl:attribute name="name" select="'ignore_maxOccurs_0'"/>
  242. <xsl:attribute name="value" select="$ignore_maxOccurs_0"/>
  243. </xsl:element>
  244. <xsl:element name="property">
  245. <xsl:attribute name="name" select="'default_db:recurse_ant_basedir'"/>
  246. <xsl:attribute name="value" select="'.'"/>
  247. </xsl:element>
  248. <property name="simpleSchema_dir" value="{$simpleSchema_dir}"/>
  249. <property name="default_db_xml_cache.public" value="{$default_db_xml_cache.public}"/>
  250. <property name="temp" value="{$temp}"/>
  251. <property name="ant-launcher.jar" value="{$ant-launcher.jar}"/>
  252. <property name="loop_path_recurs_xpath" value="{$loop_path_recurs_xpath}"/>
  253. <property name="default_db:recurse_ant" value="{$recurse_ant}"/>
  254. <property name="build_check_java_process_count.xml" value="{$build_check_java_process_count.xml}"/>
  255. <property name="parallel_java_process_max" value="{$parallel_java_process_max}"/>
  256. <property name="feature_pos_parent" value="{$feature_pos_parent}"/>
  257. <property name="parallel_pos" value="{$parallel_pos}"/>
  258. <property name="get_wfs" location="{$get_wfs}"/>
  259. <xsl:comment>
  260. #224 Important variables:
  261. typeName=<xsl:value-of select="$typeName"/>;
  262. xpath=<xsl:value-of select="$xpath"/>;
  263. xpath_value=<xsl:value-of select="$xpath_value"/>;
  264. $passwordBase64Basic=<xsl:value-of select="$passwordBase64Basic"/>
  265. $typeName_dita= <xsl:value-of select="$typeName_dita"/>
  266. $featureID_name_dita= <xsl:value-of select="$featureID_name_dita"/>
  267. $wfs_output= <xsl:value-of select="$wfs_output"/>
  268. $wfs_output.xml= <xsl:value-of select="$wfs_output.xml"/>
  269. $wfs_output.dita= <xsl:value-of select="$wfs_output.dita"/>
  270. $xpath_dita= <xsl:value-of select="$xpath_dita"/>
  271. $xpath_value_dita= <xsl:value-of select="$xpath_value_dita"/>
  272. $ignore_maxOccurs= <xsl:value-of select="$ignore_maxOccurs_0"/> ; @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>
  273. $xpath_query=<xsl:value-of select="$xpath_query"/>;
  274. $feature_pos_parent=<xsl:value-of select="$feature_pos_parent"/>;
  275. $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/> ;
  276. $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/> ;
  277. $loop_path_recurs = <xsl:value-of select="$loop_path_recurs"/> ;
  278. </xsl:comment>
  279. <tempfile suffix=".xml" destdir="{$process_locks}" deleteonexit="yes" createfile="yes" prefix="RelatedFeature_{@xml_id}_{$featureID_name_dita}_{$feature_pos_parent}_{$feature_pos}">
  280. <xsl:attribute name="property" select="concat('builds_to_ant_lock_proj',$loop_path_recurs,$loop_xpath)"/>
  281. </tempfile>
  282. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  283. <xsl:if test="$debug &gt; 1"><echo> #302 waliduje xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; </echo></xsl:if>
  284. <target name="get_related_feature_run_child_ant_check{$loop_xpath_real}">
  285. <mkdir dir="{$temp}/{$loop_xpath}"/>
  286. <!--<xsl:element name="tempfile">
  287. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos)"/>
  288. <xsl:attribute name="deleteonexit" select="'no'"/>
  289. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  290. <xsl:attribute name="suffix" select="'.xml'"/>
  291. <xsl:attribute name="prefix" select="concat('.__test_featureID_name_dita_',$featureID_name_dita,$feature_pos_parent,'.',$feature_pos)"/>
  292. </xsl:element>-->
  293. <!--<xsl:element name="echoxml">
  294. <xsl:attribute name="file" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos,'}')"/>
  295. <xsl:element name="{$featureID_name_dita}">
  296. <xsl:attribute name="position" select="position()"/></xsl:element><!-\- bylo bug @2017-04 position() -\->
  297. </xsl:element>-->
  298. <xsl:element name="tempfile">
  299. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml',$feature_pos_parent,$feature_pos)"/>
  300. <xsl:attribute name="deleteonexit" select="'no'"/>
  301. <xsl:attribute name="destdir" select="$temp"/>
  302. <xsl:attribute name="suffix" select="'.xml'"/>
  303. <xsl:attribute name="prefix" select="concat('.__test_featureID_name_dita_out_',$featureID_name_dita,$feature_pos_parent,'.',$feature_pos)"/>
  304. </xsl:element>
  305. <xsl:element name="echoxml">
  306. <xsl:attribute name="file" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml',$feature_pos_parent,$feature_pos,'}')"/>
  307. <xpath_query_test>OK</xpath_query_test>
  308. </xsl:element>
  309. <!--<echo>#380 processing $xpath_query.xsl in <xsl:value-of select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos,'}')"/></echo>-->
  310. <!--<xmlvalidate lenient="true">
  311. <xsl:attribute name="file" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos,'}')"/>
  312. </xmlvalidate>-->
  313. <!--<xsl:element name="xslt">
  314. <!-\-<xsl:attribute name="basedir" select="'./'"/>-\->
  315. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  316. <xsl:attribute name="in" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos,'}')"/>
  317. <!-\-<xsl:attribute name="destdir" select="'./'"/>-\->
  318. <xsl:attribute name="out" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml',$feature_pos_parent,$feature_pos,'}')"/>
  319. <factory name="net.sf.saxon.TransformerFactoryImpl">
  320. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  321. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  322. </factory>
  323. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  324. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  325. </xsl:element>-->
  326. <!-- running another java env transform for safety -->
  327. <!--<java>
  328. <xsl:attribute name="jar" select="'/opt/local/share/java/saxon9he.jar'"/>
  329. <!-\-<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-\->
  330. <xsl:attribute name="dir" select="concat($temp,'/',$loop_xpath,'/')"/>
  331. <xsl:attribute name="fork" select="'true'"/>
  332. <xsl:attribute name="clonevm" select="'false'"/>
  333. <xsl:attribute name="newenvironment" select="'true'"/>
  334. <xsl:attribute name="failonerror" select="'true'"/>
  335. <!-\-<xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>-\->
  336. <!-\-<xsl:attribute name="output" select="concat(.,'_out.log')"/>-\->
  337. <xsl:element name="arg">
  338. <xsl:attribute name="line" select="concat('-s:${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos,'}')"/>
  339. </xsl:element>
  340. <xsl:element name="arg">
  341. <xsl:attribute name="line" select="concat('-o:${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml',$feature_pos_parent,$feature_pos,'}')"/>
  342. </xsl:element>
  343. <arg line="-xsl:{$xpath_query.xsl}"/>
  344. <arg line="-im:xpath_query_test"/>
  345. </java>-->
  346. <xsl:if test="$debug &gt; 1"> <echo>#394 after not processing $xpath_query.xsl in <xsl:value-of select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos,'}')"/></echo></xsl:if>
  347. <xsl:element name="loadfile">
  348. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile.xml',$feature_pos_parent,$feature_pos)"/>
  349. <xsl:attribute name="srcfile" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml',$feature_pos_parent,$feature_pos,'}')"/>
  350. </xsl:element>
  351. <condition taskname="get_related_feature_run_child_ant_if{$loop_xpath_real}">
  352. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile_check.xml',$feature_pos_parent,$feature_pos)"/>
  353. <xsl:element name="contains">
  354. <xsl:attribute name="string" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile.xml',$feature_pos_parent,$feature_pos,'}')"/>
  355. <xsl:attribute name="substring" select="'OK'"/>
  356. </xsl:element>
  357. </condition>
  358. </target>
  359. <delete quiet="true">
  360. <xsl:attribute name="file" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml',$feature_pos_parent,$feature_pos,'}')"/>
  361. </delete>
  362. <delete quiet="true">
  363. <xsl:attribute name="file" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml',$feature_pos_parent,$feature_pos,'}')"/>
  364. </delete>
  365. <target name="get_related_feature_run_child_ant_if{$loop_xpath_real}" depends="get_related_feature_run_child_ant_check{$loop_xpath_real}">
  366. <xsl:attribute name="if" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile_check.xml',$feature_pos_parent,$feature_pos,'}')"/>
  367. <antcall target="get_related_feature_run_child_ant{$loop_xpath_real}"/>
  368. </target>
  369. <!-- EOF dajemy wpis o walidacji danego feature pod katem xpath_query -->
  370. <xsl:apply-templates mode="ant_target" select=".">
  371. <xsl:with-param name="typeName_dita" select="$typeName_dita"/>
  372. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  373. <xsl:with-param name="wfs_output" select="$wfs_output"/>
  374. <xsl:with-param name="wfs_output.xml" select="$wfs_output.xml"/>
  375. <xsl:with-param name="wfs_output.dita" select="$wfs_output.dita"/>
  376. <xsl:with-param name="xpath" select="$xpath"/>
  377. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  378. <xsl:with-param name="featureID_name" select="$featureID_name"/>
  379. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  380. <xsl:with-param name="RelatedFeatureCount" select="$RelatedFeatureCount"/>
  381. <xsl:with-param name="RelatedFeaturePos" select="$RelatedFeaturePos"/>
  382. <xsl:with-param name="typeName" select="$typeName"/>
  383. <xsl:with-param name="xpath_value" select="$xpath_value"/>
  384. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  385. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  386. <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath_save"/>-->
  387. <xsl:with-param name="xml_id" select="$xml_id"/>
  388. <!--<xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>-->
  389. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  390. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  391. <xsl:with-param name="typeNameRealResource" select="$typeNameRealResource"/>
  392. <xsl:with-param name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/>
  393. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/> <!-- @2017-04 dodanie do przetwarzania result-document href="{$temp}/{@xml_id}.{$uuid}.{$feature_pos}/build_root.xml -->
  394. </xsl:apply-templates>
  395. <!-- na koniec przetwarzania kazdego z wezlow, podmieniamy xsl biezacy wezel -->
  396. <xsl:comment>template match="RelatedFeature" mode="after_first_ant_assing_vars_childs"
  397. robi result-document href="build_{$loop_xpath}.{$uuid}.xml
  398. wiec powinnismy uruchomic ant ten plik w ciemno znajac jego nizsze wezly</xsl:comment>
  399. <xsl:variable name="featureID_name_child" select="substring-after($typeName,':')"/>
  400. <!--<xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>-->
  401. <xsl:element name="target">
  402. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath_real)"/>
  403. <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos,$loop_xpath_real)"/>
  404. <!--<xsl:choose>
  405. <xsl:when test=".//(RelatedFeature|RelatedFeatureRoot)">
  406. <xsl:for-each select=".//RelatedFeature[ not(child::node()/name()='RelatedFeature')]">
  407. <xsl:variable name="loop_xpath_child_ant" select="concat($loop_xpath_save,'_x2f_.',@xml_id,'.',$featureID_name)"/>
  408. <xsl:message>#148 ustalamy $loop_xpath_child_ant=<xsl:value-of select="$loop_xpath_child_ant"/></xsl:message>
  409. <!-\- <xsl:element name="target">
  410. <xsl:attribute name="name" select="$loop_xpath_child_ant"/><!-\\-'get_related_feature_run_child_ant'-\\->
  411. <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>-\->
  412. <!-\-<ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.xml" dir="."/>-\->
  413. <ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>
  414. <!-\-</xsl:element>-\->
  415. <xsl:if test=" position()=last()">
  416. <xsl:comment>Tu task z related</xsl:comment>
  417. </xsl:if>
  418. </xsl:for-each>
  419. </xsl:when>
  420. <xsl:otherwise>
  421. <xsl:comment>#135 nie ma wiecej //RelatedFeature</xsl:comment>
  422. <!-\-<xsl:element name="target">
  423. <xsl:attribute name="name" select="'get_related_feature_run_child_ant'"/>
  424. <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>
  425. </xsl:element>-\->
  426. </xsl:otherwise>
  427. </xsl:choose>-->
  428. <!-- wstawienie subanta dla biezacych dzieci only -->
  429. <tempfile prefix=".builds_to_ant_set_parallel_java_process_max_xsl" suffix=".xml" destdir="{$temp}" >
  430. <xsl:attribute name="property" select="concat('builds_to_ant_set_parallel_java_process_max_xsl',$loop_path_recurs,$loop_xpath_real)"/>
  431. </tempfile>
  432. <ant antfile="{$build_check_java_process_count.xml}">
  433. <xsl:attribute name="output" select="concat('${builds_to_ant_set_parallel_java_process_max_xsl',$loop_path_recurs,$loop_xpath_real,'}')"/>
  434. <property name="builds_to_ant_set_parallel_java_process_max">
  435. <xsl:attribute name="value" select="concat('${builds_to_ant_set_parallel_java_process_max_xsl',$loop_path_recurs,$loop_xpath_real,'}')"/>
  436. </property>
  437. <property name="process_locks" value="{$process_locks}"/>
  438. </ant>
  439. <loadfile>
  440. <xsl:attribute name="property" select="concat('builds_to_ant_set_parallel_java_process_max_loadfile_xsl',$loop_path_recurs,$loop_xpath_real)"/>
  441. <xsl:attribute name="srcfile" select="concat('${builds_to_ant_set_parallel_java_process_max_xsl',$loop_path_recurs,$loop_xpath_real,'}')"/>
  442. </loadfile>
  443. <delete quiet="true">
  444. <xsl:attribute name="file" select="concat('${builds_to_ant_set_parallel_java_process_max_xsl',$loop_path_recurs,$loop_xpath_real,'}')"/>
  445. </delete>
  446. <parallel>
  447. <xsl:attribute name="threadcount" select="concat('${builds_to_ant_set_parallel_java_process_max_loadfile_xsl',$loop_path_recurs,$loop_xpath_real,'}')"/>
  448. <xsl:apply-templates mode="place_subant">
  449. <xsl:with-param name="uuid" select="$uuid"/>
  450. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  451. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  452. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  453. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  454. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  455. <xsl:with-param name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/>
  456. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
  457. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  458. <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
  459. <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
  460. </xsl:apply-templates>
  461. </parallel>
  462. <xsl:if test="$debug &gt; 1"><echo>
  463. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #197 LEAF RelatedFeature PROJECT FINISH RUN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  464. | $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/> ;
  465. | $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/> ;
  466. | @xml_id is <xsl:value-of select="@xml_id"/> ; wfs_output.xml = <xsl:value-of select="$wfs_output.xml"/>; $wfs_output.dita = <xsl:value-of select="$wfs_output.dita"/>;
  467. | $feature_pos_parent= <xsl:value-of select="$feature_pos_parent"/>; $feature_pos= <xsl:value-of select="$feature_pos"/>; position()= <xsl:value-of select="position()"/>
  468. | $temp is = <xsl:value-of select="$temp"/> ;
  469. | $loop_xpath = <xsl:value-of select="$loop_xpath"/> projekt <xsl:value-of select="$loop_xpath_real"/>;
  470. | ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>; $feature_pos_parent= <xsl:value-of select="$feature_pos_parent"/>;
  471. | $input_obj_fid/@fid = <xsl:value-of select="$input_obj_fid/@fid"/> ;
  472. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  473. </echo></xsl:if>
  474. </xsl:element>
  475. <!-- na koniec przetwarzania danego zaglebienia uruchamiamy calosc ponownie do kolejnego zaglebienia -->
  476. <!-- task do polaczenia zaglebien -->
  477. <!-- jak nie ma zaglebien to generujemy pdf i dajemy uzytkownikowi linka -->
  478. <delete quiet="true">
  479. <xsl:attribute name="file" select="concat('${builds_to_ant_lock_proj',$loop_path_recurs,$loop_xpath,'}')"/>
  480. </delete>
  481. </project>
  482. </xsl:when>
  483. <xsl:when test="name()='RelatedFeatureLoop'">
  484. <xsl:if test="$debug &gt; 2"><xsl:message>%%%%%%%%%%%%%%%%%%%%%% 255 Creating BUILD for RelatedFeatureLoop - which will be try to execute child ant in loop_path=xml_id(<xsl:value-of select="@xml_id"/>)</xsl:message></xsl:if>
  485. <xsl:variable name="RelatedFeatureCount" select="last()"/>
  486. <xsl:variable name="RelatedFeaturePos" select="position()"/>
  487. <xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
  488. <xsl:variable name="loop_xpath_real" select="$loop_xpath"/>
  489. <xsl:variable name="loop_xpath">
  490. <xsl:choose>
  491. <xsl:when test="$loop_xpath='root'">
  492. <!--bylo <xsl:value-of select="concat($loop_xpath,'_x2f_.',@xml_id,'.',$featureID_name)"/>-->
  493. <xsl:value-of select="concat($loop_xpath,'/',@xml_id,'.',$feature_pos)"/> <!-- loop path too long ,'.',$featureID_name -->
  494. </xsl:when>
  495. <xsl:otherwise><xsl:value-of select="$loop_xpath"/></xsl:otherwise>
  496. </xsl:choose>
  497. </xsl:variable>
  498. <xsl:variable name="typeName_dita" select="@typeName"/>
  499. <xsl:variable name="typeNameRealResource">
  500. <!-- override in case of different real resource by filtered resource -->
  501. <xsl:choose>
  502. <xsl:when test="@typeNameRealResource"><xsl:value-of select="@typeNameRealResource"/></xsl:when>
  503. <xsl:otherwise><xsl:value-of select="@typeName"/></xsl:otherwise>
  504. </xsl:choose>
  505. </xsl:variable>
  506. <xsl:variable name="featureID_name_dita" select="substring-after($typeName_dita,':')"/>
  507. <xsl:variable name="xml_id" select="@xml_id"/>
  508. <xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath)"/>
  509. <xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.xml')"/>
  510. <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.dita.xml')"/>
  511. <xsl:variable name="xpath_dita" select="@xpath"/>
  512. <xsl:variable name="xpath_value_dita">
  513. <xsl:choose>
  514. <xsl:when test="@xpath_value">
  515. <xsl:if test="$debug &gt; 2"><xsl:message>%%%%%%%%%%%%%%%%%%%%%% #265.1 $input_obj_with_xpath: <xsl:copy-of select="$input_obj_with_xpath"/> </xsl:message></xsl:if>
  516. <xsl:call-template name="xpath_filter_apply">
  517. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  518. <xsl:with-param name="xpath" select="@xpath"/>
  519. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  520. </xsl:call-template>
  521. </xsl:when>
  522. <xsl:otherwise>
  523. <xsl:value-of select="$xpath_value"/><!-- parametr z template narzuca wartosc -->
  524. </xsl:otherwise>
  525. </xsl:choose>
  526. </xsl:variable>
  527. <xsl:comment>
  528. RelatedFeatureLoop: #344
  529. $loop_xpath_real =<xsl:value-of select="$loop_xpath_real"/> ;
  530. $typeName_dita= <xsl:value-of select="$typeName_dita"/>
  531. $featureID_name_dita= <xsl:value-of select="$featureID_name_dita"/>
  532. $wfs_output= <xsl:value-of select="$wfs_output"/>
  533. $wfs_output.xml= <xsl:value-of select="$wfs_output.xml"/>
  534. $wfs_output.dita= <xsl:value-of select="$wfs_output.dita"/>
  535. $xpath_dita= <xsl:value-of select="$xpath_dita"/>
  536. $xpath_value_dita= <xsl:value-of select="$xpath_value_dita"/>
  537. $ignore_maxOccurs= <xsl:value-of select="$ignore_maxOccurs_0"/> ; @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>
  538. $xpath_query=<xsl:value-of select="$xpath_query"/>;
  539. $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/> ;
  540. $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/> ;
  541. $parallel_pos = <xsl:value-of select="$parallel_pos"/> ;
  542. </xsl:comment>
  543. <project basedir="{$recurse_ant_basedir.temp}{$loop_path_recurs}"> <!-- name="get_related_feature{$loop_xpath_real}_{$loop_path_recurs} --> <!-- get_related_feature_run_child_ant{$loop_xpath_real}_{$loop_path_recurs -->
  544. <xsl:attribute name="name" select="concat('get_related_feature',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  545. <xsl:attribute name="default" select="concat('get_related_feature_run_child_ant_if_query_',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/> <!-- get_related_feature_run_child_ant_if_query_{$loop_xpath_real}_{$loop_path_recurs} -->
  546. <!-- default przed 2017-03-28 concat('get_related_feature_run_child_ant_if_query_',$loop_xpath_real,'_',$loop_path_recurs)
  547. get_related_feature_run_child_ant{$loop_xpath_real}_{$loop_path_recurs} -->
  548. <xsl:comment>RelatedFeatureCount:<xsl:value-of select="count(*)"/></xsl:comment>
  549. <xsl:if test="$debug &gt; 1"><echo>
  550. ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?- #550 RelatedFeatureLoop BEGIN RUN TRY TRY TRY -?-?-?-?-?-?-?-?-?-?-?-?-?
  551. | @xml_id is <xsl:value-of select="@xml_id"/> ; $parallel_pos = <xsl:value-of select="$parallel_pos"/> ; $parallel_pos= <xsl:value-of select="$parallel_pos"/>; $$parallel_pos = ${parallel_pos}
  552. ? $temp is = <xsl:value-of select="$temp"/> ;
  553. | ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>;
  554. ? $loop_xpath_real = <xsl:value-of select="$loop_xpath_real"/>;
  555. | $loop_xpath = <xsl:value-of select="$loop_xpath"/> ;
  556. | $loop_path_recurs = <xsl:value-of select="$loop_path_recurs"/> ;
  557. ? $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/> ;
  558. | $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/> ;
  559. ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?
  560. </echo></xsl:if>
  561. <xsl:if test="$debug &gt; 1"><echo> ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>; projekt <xsl:value-of select="$loop_xpath_real"/>; </echo></xsl:if>
  562. <!--<xsl:variable name="typeName" select='replace($typeName,"&quot;","")'/>--><!-- oczyszczenie z apostrofow -->
  563. <xsl:element name="property">
  564. <xsl:attribute name="name" select="'uuid'"/>
  565. <xsl:attribute name="value" select="$uuid"/>
  566. </xsl:element>
  567. <xsl:element name="property">
  568. <xsl:attribute name="name" select="'passwordBase64Basic'"/>
  569. <xsl:attribute name="value" select="$passwordBase64Basic"/>
  570. </xsl:element>
  571. <xsl:element name="property">
  572. <xsl:attribute name="name" select="'php_session_id'"/>
  573. <xsl:attribute name="value" select="$cookie_curl_option"/>
  574. </xsl:element>
  575. <xsl:element name="property">
  576. <xsl:attribute name="name" select="'php_session_id_tested'"/>
  577. <xsl:attribute name="value" select="$cookie_curl_option"/>
  578. </xsl:element>
  579. <!--<xsl:element name="property">
  580. <xsl:attribute name="name" select="'url'"/>
  581. <xsl:attribute name="value" select="$url"/>
  582. </xsl:element>-->
  583. <xsl:element name="property">
  584. <xsl:attribute name="name" select="'webRootUrl'"/>
  585. <xsl:attribute name="value" select="$webRootUrl"/>
  586. </xsl:element>
  587. <xsl:element name="property"> <!--- powinien miec domyslnie sciezke narzucona-->
  588. <xsl:attribute name="name" select="'build_recurse_ant.xsl'"/>
  589. <xsl:attribute name="value" select="$build_recurse_ant.xsl"/>
  590. </xsl:element>
  591. <!--<xsl:element name="property"> <!-\-\- powinien miec domyslnie narzucona sciezke-\->
  592. <xsl:attribute name="name" select="'temp'"/>
  593. <xsl:attribute name="value" select="$temp"/>
  594. </xsl:element>-->
  595. <xsl:element name="property"><!-- - powinien miec sciezke domyslnie narzucona-->
  596. <xsl:attribute name="name" select="'builds_to_ant.xsl'"/>
  597. <xsl:attribute name="value" select="$builds_to_ant.xsl"/>
  598. </xsl:element>
  599. <property name="typeName" value="{$typeName}"/>
  600. <property name="xpath" value="{$xpath_dita}"/>
  601. <property name="xpath_value" value="{$xpath_value_dita}"/>
  602. <!-- DtypeName=p5_default_db:CRM_PROCES -Dxpath=ID -Dxpath_value=5247 -->
  603. <property name="loop_path_recurs" value="{$loop_path_recurs}"/>
  604. <xsl:element name="property">
  605. <xsl:attribute name="name" select="'xpath_query'"/>
  606. <xsl:attribute name="value" select="$xpath_query"/>
  607. </xsl:element>
  608. <xsl:element name="property">
  609. <xsl:attribute name="name" select="'ignore_maxOccurs_0'"/>
  610. <xsl:attribute name="value" select="$ignore_maxOccurs_0"/>
  611. </xsl:element>
  612. <xsl:element name="property">
  613. <xsl:attribute name="name" select="'default_db:recurse_ant_basedir'"/>
  614. <xsl:attribute name="value" select="$recurse_ant_basedir"/>
  615. </xsl:element>
  616. <xsl:element name="property">
  617. <xsl:attribute name="name" select="'default_db:recurse_ant'"/>
  618. <xsl:attribute name="value" select="$recurse_ant"/>
  619. </xsl:element>
  620. <xsl:element name="property">
  621. <xsl:attribute name="name" select="'default_db:recurse_ant_basedir.temp'"/>
  622. <xsl:attribute name="value" select="$recurse_ant_basedir.temp"/>
  623. </xsl:element>
  624. <property name="simpleSchema_dir" value="{$simpleSchema_dir}"/>
  625. <property name="default_db_xml_cache.public" value="{$default_db_xml_cache.public}"/>
  626. <!--bylo przed @2017-04 - poprawiam bo sie zapetla niepotrzebnie - tempa doklei wyzwolony ant do ${default_db:recurse_ant_basedir.temp}${loop_path_recurs}-->
  627. <xsl:element name="property">
  628. <xsl:attribute name="name" select="'temp'"/>
  629. <xsl:attribute name="value" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
  630. </xsl:element>
  631. <!--<xsl:element name="property">
  632. <xsl:attribute name="name" select="'temp'"/>
  633. <xsl:attribute name="value" select="$temp"/>
  634. </xsl:element>-->
  635. <property name="ant-launcher.jar" value="{$ant-launcher.jar}"/>
  636. <property name="loop_path_recurs_xpath" value="{$loop_path_recurs_xpath}"/>
  637. <property name="build_check_java_process_count.xml" value="{$build_check_java_process_count.xml}"/>
  638. <property name="parallel_java_process_max" value="{$parallel_java_process_max}"/>
  639. <property name="feature_pos_parent" value="{$feature_pos_parent}"/> <!-- @2017-04 fixing leaf parallel conflict -->
  640. <property name="parallel_pos" value="{$parallel_pos}"/>
  641. <property name="process_locks" value="{$process_locks}"/>
  642. <property name="get_wfs" location="{$get_wfs}"/>
  643. <xsl:comment>
  644. #555 Important variables:
  645. typeName=<xsl:value-of select="$typeName"/>;
  646. xpath=<xsl:value-of select="$xpath"/>;
  647. xpath_value=<xsl:value-of select="$xpath_value"/>;
  648. $passwordBase64Basic=<xsl:value-of select="$passwordBase64Basic"/>
  649. $feature_pos_parent" <xsl:value-of select="$feature_pos_parent"/>
  650. $typeNameRoot <xsl:value-of select="$typeNameRoot"/>
  651. $input_obj_fid/@fid = <xsl:value-of select="$input_obj_fid/@fid"/> ;
  652. </xsl:comment>
  653. <!--<xsl:apply-templates mode="ant_target" select=".">
  654. <xsl:with-param name="typeName_dita" select="$typeName_dita"/>
  655. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  656. <xsl:with-param name="wfs_output" select="$wfs_output"/>
  657. <xsl:with-param name="wfs_output.xml" select="$wfs_output.xml"/>
  658. <xsl:with-param name="wfs_output.dita" select="$wfs_output.dita"/>
  659. <xsl:with-param name="xpath" select="$xpath"/>
  660. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  661. <xsl:with-param name="featureID_name" select="$featureID_name"/>
  662. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  663. <xsl:with-param name="RelatedFeatureCount" select="$RelatedFeatureCount"/>
  664. <xsl:with-param name="RelatedFeaturePos" select="$RelatedFeaturePos"/>
  665. <xsl:with-param name="typeName" select="$typeName"/>
  666. <xsl:with-param name="xpath_value" select="$xpath_value"/>
  667. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  668. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  669. <!-\-<xsl:with-param name="loop_xpath_save" select="$loop_xpath_save"/>-\->
  670. <xsl:with-param name="xml_id" select="$xml_id"/>
  671. <!-\-<xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>-\->
  672. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  673. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  674. </xsl:apply-templates>-->
  675. <!-- na koniec przetwarzania kazdego z wezlow, podmieniamy xsl biezacy wezel -->
  676. <xsl:comment>template match="RelatedFeature" mode="after_first_ant_assing_vars_childs"
  677. robi result-document href="build_{$loop_xpath}.{$uuid}.xml
  678. wiec powinnismy uruchomic ant ten plik w ciemno znajac jego nizsze wezly</xsl:comment>
  679. <xsl:variable name="featureID_name_child" select="substring-after($typeName,':')"/>
  680. <!--<xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>-->
  681. <xsl:if test="$debug &gt; 2"><xsl:message>%%%%%%%%%%%%%%%%%%%%%% #142 ustalamy maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; </xsl:message></xsl:if>
  682. <tempfile suffix=".xml" destdir="{$process_locks}" deleteonexit="yes" createfile="yes" prefix="RelatedFeatureLoop_{@xml_id}_{$featureID_name_dita}_{$feature_pos_parent}_{$feature_pos}_{$parallel_pos}">
  683. <xsl:attribute name="property" select="concat('process_lock_loop',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  684. </tempfile>
  685. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  686. <xsl:if test="$debug &gt; 1"><echo> #592 waliduje xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; </echo></xsl:if>
  687. <mkdir dir="{$temp}/{$loop_xpath}"/>
  688. <target>
  689. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant_if_query_test',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  690. <xsl:element name="tempfile">
  691. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  692. <xsl:attribute name="deleteonexit" select="'no'"/>
  693. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  694. <xsl:attribute name="suffix" select="'.xml'"/>
  695. <xsl:attribute name="prefix" select="concat('.__test_featureID_name_dita_',$featureID_name_dita,@xml_id,$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos)"/>
  696. </xsl:element>
  697. <xsl:element name="echoxml">
  698. <xsl:attribute name="file" select="concat('${get_related_feature_run_child_ant_xpath_test_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  699. <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/><xsl:attribute name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/></xsl:element>
  700. </xsl:element>
  701. <xsl:element name="tempfile">
  702. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test_out_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  703. <xsl:attribute name="deleteonexit" select="'no'"/>
  704. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  705. <xsl:attribute name="suffix" select="'.xml'"/>
  706. <xsl:attribute name="prefix" select="concat('.__test_featureID_name_dita_out_',$featureID_name_dita,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  707. </xsl:element>
  708. <xsl:element name="echoxml">
  709. <xsl:attribute name="file" select="concat('${get_related_feature_run_child_ant_xpath_test_out_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  710. <xpath_query_test>OK</xpath_query_test>
  711. </xsl:element>
  712. <!--<sleep>
  713. <xsl:attribute name="milliseconds" select="concat($parallel_pos,'000')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  714. </sleep>-->
  715. <!--<sleep>
  716. <xsl:attribute name="milliseconds" select="concat('${parallel_pos}','000')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  717. </sleep>-->
  718. <!--<echo>#739 processing $xpath_query.xsl in <xsl:value-of select="concat('${get_related_feature_run_child_ant_xpath_test_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></echo>-->
  719. <!--<exec executable="cat">
  720. <arg><xsl:attribute name="line" select="concat('${get_related_feature_run_child_ant_xpath_test_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></arg>
  721. </exec>-->
  722. <!--<xsl:element name="xslt">
  723. <!-\-<xsl:attribute name="basedir" select="concat($temp,'/',$loop_xpath)"/>-\->
  724. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  725. <xsl:attribute name="in" select="$empty.xml"/>
  726. <!-\-<xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>-\->
  727. <xsl:attribute name="out" select="concat('${get_related_feature_run_child_ant_xpath_test_out_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  728. <factory name="net.sf.saxon.TransformerFactoryImpl">
  729. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  730. <attribute name="http://saxon.sf.net/feature/initialTemplate" value="input"/>
  731. </factory>
  732. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  733. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  734. <param name="input">
  735. <xsl:attribute name="expression" select="concat('${get_related_feature_run_child_ant_xpath_test_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  736. </param>
  737. </xsl:element>-->
  738. <!--<xsl:element name="xslt">
  739. <!-\-<xsl:attribute name="basedir" select="concat($temp,'/',$loop_xpath)"/>-\->
  740. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  741. <xsl:attribute name="in" select="concat('${get_related_feature_run_child_ant_xpath_test_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  742. <!-\-<xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>-\->
  743. <xsl:attribute name="out" select="concat('${get_related_feature_run_child_ant_xpath_test_out_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  744. <xsl:attribute name="reloadstylesheet" select="'true'"/>
  745. <factory name="net.sf.saxon.TransformerFactoryImpl">
  746. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  747. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  748. </factory>
  749. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  750. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  751. </xsl:element>-->
  752. <xsl:if test="$debug &gt; 1"><echo>#754 EOF NOT processing $xpath_query.xsl in <xsl:value-of select="concat('${get_related_feature_run_child_ant_xpath_test',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></echo></xsl:if>
  753. <xsl:element name="loadfile">
  754. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test_loadfile_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  755. <xsl:attribute name="srcfile" select="concat('${get_related_feature_run_child_ant_xpath_test_out_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  756. </xsl:element>
  757. <!--<echo>#633 test NOT xpath_query.xsl ${<xsl:value-of select="concat('get_related_feature_run_child_ant_xpath_test_loadfile_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>} ;</echo>-->
  758. <condition>
  759. <xsl:attribute name="taskname" select="concat('get_related_feature_run_child_ant_if_query_',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  760. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test_loadfile_check',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  761. <xsl:element name="contains">
  762. <xsl:attribute name="string" select="concat('${get_related_feature_run_child_ant_xpath_test_loadfile_proj',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  763. <xsl:attribute name="substring" select="'OK'"/>
  764. </xsl:element>
  765. </condition>
  766. </target>
  767. <target>
  768. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant_if_query_',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  769. <xsl:attribute name="depends" select="concat('get_related_feature_run_child_ant_if_query_test',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  770. <xsl:attribute name="if" select="concat('${get_related_feature_run_child_ant_xpath_test_loadfile_check',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  771. <antcall > <!-- target="get_related_feature_run_child_ant{$loop_xpath}_{$loop_path_recurs}" -->
  772. <xsl:attribute name="target" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  773. </antcall>
  774. </target>
  775. <!-- EOF dajemy wpis o walidacji danego feature pod katem xpath_query -->
  776. <!-- warunek dla ograniczenia zapetlenia TODO do optymalizacji aby nie potrzebnie nie robilo zapytania czy jest wezel zaglebiony -->
  777. <xsl:element name="target">
  778. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_check',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/> <!-- concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_check') -->
  779. <!--<tempfile property="test_child_curl_ouptut.xml"/>--> <!-- todo deleteonexit=yes -->
  780. <!--<xsl:element name="tempfile">
  781. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)" />
  782. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  783. <xsl:attribute name="prefix" select="'.test_if_exec_child_ant-'"/>
  784. <xsl:attribute name="suffix" select="'.xml'"/>
  785. </xsl:element>-->
  786. <xsl:element name="property">
  787. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)" />
  788. <xsl:attribute name="location" select="concat($temp,'/',$loop_xpath,'/.test_if_exec_child_ant.xml')"/>
  789. </xsl:element>
  790. <xsl:variable name="OGC_Filter">
  791. <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
  792. <xsl:with-param name="simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
  793. <xsl:with-param name="RelatedFilter" select="RelatedFilter"/>
  794. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  795. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  796. </xsl:call-template>
  797. </xsl:variable>
  798. <xsl:variable name="url">
  799. <xsl:value-of select="$api_url"/>/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=<xsl:value-of select="$typeNameRealResource"/>&amp;SRSNAME=EPSG:3003&amp;resultType=hits<xsl:value-of select="$OGC_Filter"/>
  800. </xsl:variable>
  801. <!--<echo>
  802. (-)(-)(-)(-)(-) #722 exec curl for $typeNameRealResource=<xsl:value-of select="$typeNameRealResource"/>
  803. (-)(-)(-)(-)(-) and $xpath_dita=<xsl:value-of select="$xpath_dita"/>; $xpath_value=<xsl:value-of select="$xpath_value"/>; and $xpath_value_dita=<xsl:value-of select="$xpath_value_dita"/>;
  804. (-)(-)(-)(-)(-) $url=<xsl:value-of select="$url"/>;
  805. (-)(-)(-)(-)(-) $wfs_output.xml = <xsl:value-of select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  806. </echo>-->
  807. <ant antfile="{$get_wfs}" target="GetXmlByUrlVerifyRetry" >
  808. <property name="output">
  809. <xsl:attribute name="value" select="concat('${get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  810. </property>
  811. <property name="url" value="{$url}"/>
  812. <property name="cookie_curl_option" value="{$cookie_curl_option}"/>
  813. </ant>
  814. <!--<xsl:element name="exec">
  815. <xsl:attribute name="executable" select="'curl'"/>
  816. <xsl:attribute name="output" select="concat('${get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  817. <xsl:attribute name="errorproperty" select="'wfs_error'"/>
  818. <xsl:attribute name="resultproperty" select="'wfs_result'"/>
  819. <xsl:element name="arg">
  820. <xsl:attribute name="line"> <xsl:value-of select="$cookie_curl_option"/> "<xsl:value-of select="$url"/>"</xsl:attribute>
  821. </xsl:element>
  822. <xsl:element name="arg">
  823. <xsl:attribute name="line">-\-connect-timeout 5</xsl:attribute>
  824. </xsl:element>
  825. <xsl:element name="arg">
  826. <xsl:attribute name="line">-\-max-time 240</xsl:attribute>
  827. </xsl:element>
  828. <xsl:element name="arg">
  829. <xsl:attribute name="line">-\-retry 5</xsl:attribute>
  830. </xsl:element>
  831. <xsl:element name="arg">
  832. <xsl:attribute name="line">-\-retry-max-time 1200</xsl:attribute>
  833. </xsl:element>
  834. </xsl:element>-->
  835. <xsl:element name="loadfile">
  836. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_msg',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  837. <xsl:attribute name="srcFile" select="concat('${get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_temp',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')" />
  838. </xsl:element>
  839. <xsl:if test="$debug &gt; 1"><echo> #752 $msg ${<xsl:value-of select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_msg',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>}
  840. check curl if child exists: <xsl:value-of select="$api_url"/>
  841. result Hits <xsl:value-of select="concat('${get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_msg',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  842. </echo></xsl:if>
  843. <xsl:element name="condition">
  844. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_test',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  845. <xsl:attribute name="taskname" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  846. <xsl:element name="contains">
  847. <xsl:attribute name="string" select="concat('${get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_msg',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  848. <xsl:attribute name="substring" select="'numberMatched=&quot;0&quot;'"/>
  849. </xsl:element>
  850. </xsl:element>
  851. </xsl:element>
  852. <!--<target name="check_if_child">
  853. <exec executable="curl"
  854. 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"
  855. errorproperty="wfs_error"
  856. resultproperty="wfs_result">
  857. <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;"/>
  858. </exec>
  859. <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" />
  860. <echo> MSG to ${msg} </echo>
  861. <condition property="test" taskname="get_related_feature_run_child_antroot_x2f_.d3e1.CRM_PROCES_x2f_.d3e16.CRM_PROCES_/d3e16" >
  862. <contains string="${msg}" substring="featureMember"/>
  863. </condition>
  864. </target>-->
  865. <xsl:element name="target">
  866. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  867. <xsl:attribute name="depends" select="concat('get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_check',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  868. <xsl:attribute name="unless" select="concat('${get_related_feature_run_child_ant',$loop_xpath,'_',$loop_path_recurs,'_test',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  869. <xsl:if test="$debug &gt; 1"><echo>
  870. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- #810 RelatedFeatureLoop LEAF STARTING RUN -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  871. | @xml_id is <xsl:value-of select="@xml_id"/> ;
  872. * $temp is = <xsl:value-of select="$temp"/> ;
  873. | ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>;
  874. * $loop_xpath_real <xsl:value-of select="$loop_xpath_real"/>;
  875. | $loop_path_recurs = <xsl:value-of select="$loop_path_recurs"/>
  876. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  877. </echo></xsl:if>
  878. <delete quiet="true">
  879. <xsl:attribute name="file" select="concat('${process_lock_loop',$loop_xpath,'_',$loop_path_recurs,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  880. </delete>
  881. <ant antfile="{$recurse_ant_basedir}/build_recurse_ant.xml" target="xml_recursed_from_tr_map" inheritall="true" />
  882. <xsl:if test="$debug &gt; 1"><echo>
  883. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- #821 RelatedFeatureLoop FIHISHED RUN -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  884. | @xml_id is <xsl:value-of select="@xml_id"/> ;
  885. * $temp is = <xsl:value-of select="$temp"/> ;
  886. | ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>;
  887. * $loop_xpath_real <xsl:value-of select="$loop_xpath_real"/>;
  888. | $loop_path_recurs = <xsl:value-of select="$loop_path_recurs"/>
  889. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  890. </echo></xsl:if>
  891. </xsl:element>
  892. <!-- na koniec przetwarzania danego zaglebienia uruchamiamy calosc ponownie do kolejnego zaglebienia -->
  893. <!-- task do polaczenia zaglebien -->
  894. <!-- jak nie ma zaglebien to generujemy pdf i dajemy uzytkownikowi linka -->
  895. <xsl:if test="$debug &gt; 2"><xsl:message>%%%%%%%%%%%%%%%%%%%%%% #871 END OF BUILDING BUILD_ROOT for RelatedFeatureLOOP </xsl:message></xsl:if>
  896. </project>
  897. </xsl:when>
  898. <xsl:otherwise>
  899. <xsl:comment>#723 child nodes</xsl:comment>
  900. <xsl:apply-templates mode="child_nodes"/>
  901. </xsl:otherwise>
  902. </xsl:choose>
  903. </xsl:template>
  904. <!-- trzeba przetwarzac child_nodes do pierwszego napotkania RelatedFeature -->
  905. <xsl:template mode="child_nodes" match="*">
  906. <xsl:copy-of select="."/>
  907. <xsl:comment>#732 eof copy . (mode=child_nodes match=*)</xsl:comment>
  908. </xsl:template>
  909. <!--<xsl:template mode="child_nodes" match="simpleTypeMakeOgcFilter">
  910. <xsl:message>#266 bypassing temporary simpleTypeMakeOgcFilter of problem with output </xsl:message>
  911. </xsl:template>-->
  912. <xsl:template mode="place_subant" match="RelatedFeature">
  913. <xsl:param name="uuid" required="yes"/>
  914. <xsl:param name="loop_xpath" required="yes"/>
  915. <xsl:param name="loop_xpath_real" required="yes"/>
  916. <xsl:param name="featureID_name_dita" required="yes"/>
  917. <xsl:param name="loop_path_recurs_xpath" required="yes"/>
  918. <xsl:param name="feature_pos_parent" required="yes"/>
  919. <xsl:param name="feature_pos" required="yes"/>
  920. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  921. <xsl:if test="$debug &gt; 1"><echo>#684 dajemy wpis o walidacji danego feature pod katem xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/> </echo></xsl:if>
  922. <!--<sleep>
  923. <xsl:attribute name="milliseconds" select="concat($parallel_pos,'0')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  924. </sleep>-->
  925. <!--<sleep>
  926. <xsl:attribute name="milliseconds" select="concat('${parallel_pos}','0')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  927. </sleep>-->
  928. <sequential>
  929. <xsl:comment>begin mode="place_subant" match="RelatedFeature"</xsl:comment>
  930. <mkdir dir="{$temp}/{$loop_xpath}"/>
  931. <!--<property>
  932. <xsl:attribute name="name" select="concat('builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>
  933. <xsl:attribute name="location" select="concat($temp,'/',$loop_xpath,'/.builds_to_ant-loop_test_featureID_name_dita_fixed_',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$featureID_name_dita)"/>
  934. </property>-->
  935. <xsl:element name="tempfile">
  936. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos)"/>
  937. <xsl:attribute name="deleteonexit" select="'no'"/>
  938. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  939. <xsl:attribute name="suffix" select="'.xml'"/>
  940. <xsl:attribute name="prefix" select="concat('.${uuid}.builds_to_ant-loop_test_featureID_name_dita_',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos)"/>
  941. </xsl:element>
  942. <!--<xsl:element name="echoxml">
  943. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  944. <EMPTY_FILE>NO_DATA</EMPTY_FILE>
  945. </xsl:element>-->
  946. <xsl:element name="echoxml">
  947. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos,'}')"/>
  948. <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/><xsl:attribute name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/></xsl:element>
  949. </xsl:element>
  950. <xsl:element name="tempfile">
  951. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>
  952. <xsl:attribute name="deleteonexit" select="'no'"/>
  953. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  954. <xsl:attribute name="suffix" select="'.xml'"/>
  955. <xsl:attribute name="prefix" select="concat('.${uuid}.builds_to_ant-loop_test_featureID_name_dita_out',@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>
  956. </xsl:element>
  957. <xsl:element name="echoxml">
  958. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  959. <xpath_query_test>OK</xpath_query_test>
  960. </xsl:element>
  961. <xsl:if test="$debug &gt; 1"><echo>#921 NOT processing $xpath_query.xsl in <xsl:value-of select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos,'}')"/></echo></xsl:if>
  962. <!--<xmlvalidate lenient="true">
  963. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos,'}')"/>
  964. </xmlvalidate>-->
  965. <!--<java>
  966. <xsl:attribute name="jar" select="'/opt/local/share/java/saxon9he.jar'"/>
  967. <!-\-<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-\->
  968. <xsl:attribute name="dir" select="concat($temp,'/',$loop_xpath,'/')"/>
  969. <xsl:attribute name="fork" select="'true'"/>
  970. <xsl:attribute name="clonevm" select="'false'"/>
  971. <xsl:attribute name="newenvironment" select="'true'"/>
  972. <xsl:attribute name="failonerror" select="'true'"/>
  973. <!-\-<xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>-\->
  974. <!-\-<xsl:attribute name="output" select="concat(.,'_out.log')"/>-\->
  975. <xsl:element name="arg">
  976. <xsl:attribute name="line" select="concat('-s:${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos,'}')"/>
  977. </xsl:element>
  978. <xsl:element name="arg">
  979. <xsl:attribute name="line" select="concat('-o:${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  980. </xsl:element>
  981. <arg line="-xsl:{$xpath_query.xsl}"/>
  982. <arg line="-im:xpath_query_test"/>
  983. </java>-->
  984. <!--<xsl:element name="xslt">
  985. <!-\-<xsl:attribute name="basedir" select="concat($temp,'/',$loop_xpath)"/>-\->
  986. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  987. <xsl:attribute name="in" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos,'}')"/>
  988. <!-\-<xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>-\->
  989. <xsl:attribute name="out" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  990. <!-\- <xsl:attribute name="failOnError" select="'false'"/> <!-\\- todo debug problems -\\->
  991. <xsl:attribute name="failOnTransformationError" select="'false'"/> <!-\\- todo debug problems -\\->
  992. <xsl:attribute name="failOnNoResources" select="'false'"/>-\->
  993. <xsl:attribute name="force" select="'true'"/>
  994. <factory name="net.sf.saxon.TransformerFactoryImpl">
  995. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  996. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  997. </factory>
  998. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  999. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  1000. </xsl:element>-->
  1001. <!--<echo>#936 EOF processing $xpath_query.xsl in <xsl:value-of select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/></echo>-->
  1002. <!-- wygenerujemy liste ant -->
  1003. <xsl:if test="$debug &gt; 1"><echo>
  1004. #686 ^_^_^_^_^_^_^_ Searching leaf build for $feature_pos_parent = <xsl:value-of select="$feature_pos_parent"/> ; $feature_pos = <xsl:value-of select="$feature_pos"/> ;
  1005. ^_^_^_^_^_^_^_ $featureID_name_dita <xsl:value-of select="$featureID_name_dita"/> ; substring-after(@typeName,':') = <xsl:value-of select=" substring-after(@typeName,':')"/> ;
  1006. ^_^_^_^_^_^_^_ @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; @xml_id = <xsl:value-of select="@xml_id"/> ;
  1007. ^_^_^_^_^_^_^_ ant szukam fileset id=builds_to_ant w <xsl:value-of select="concat($temp,'/',$loop_xpath)"/> includes="<xsl:value-of select="concat(@xml_id,'.*.',substring-after(@typeName,':'))"/>"
  1008. </echo></xsl:if>
  1009. <dirset id="builds_to_ant{$loop_path_recurs}{$loop_xpath_real}{@xml_id}.{$feature_pos_parent}.{$feature_pos}" dir="{$temp}/{$loop_xpath}" includes="{@xml_id}.*" /> <!-- loop path too long .{substring-after(@typeName,':')} -->
  1010. <property name="builds_to_ant{$loop_path_recurs}{$loop_xpath_real}{@xml_id}.{$feature_pos_parent}.{$feature_pos}" refid="builds_to_ant{$loop_path_recurs}{$loop_xpath_real}{@xml_id}.{$feature_pos_parent}.{$feature_pos}"/>
  1011. <!--<tempfile property="builds_to_ant.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.builds_to_ant-"/>-->
  1012. <xsl:element name="tempfile">
  1013. <xsl:attribute name="property" select="concat('builds_to_ant.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>
  1014. <xsl:attribute name="deleteonexit" select="'no'"/>
  1015. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1016. <xsl:attribute name="suffix" select="'.xml'"/>
  1017. <xsl:attribute name="prefix" select="concat('.${uuid}.builds_to_ant-',@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>
  1018. </xsl:element>
  1019. <!--<tempfile property="builds_to_ant_file.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.build_to_ant_file-"/>-->
  1020. <xsl:element name="tempfile">
  1021. <xsl:attribute name="property" select="concat('builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>
  1022. <xsl:attribute name="deleteonexit" select="'no'"/>
  1023. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1024. <xsl:attribute name="suffix" select="'.xml'"/>
  1025. <xsl:attribute name="prefix" select="concat('.${uuid}.build_to_ant_file-',@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>
  1026. </xsl:element>
  1027. <xsl:if test="$debug &gt; 1"><echo>#235 ant do: builds_to_ant.xml=${builds_to_ant_file.xml} mode="place_subant" match="RelatedFeature" </echo></xsl:if>
  1028. <!--<echoxml file="'${builds_to_ant.xml}'"><builds_to_ant>${builds_to_ant}</builds_to_ant></echoxml>-->
  1029. <xsl:element name="echoxml">
  1030. <xsl:attribute name="file" select="concat('${builds_to_ant.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1031. <builds_to_ant>${builds_to_ant<xsl:value-of select="concat($loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos)"/>}</builds_to_ant>
  1032. </xsl:element>
  1033. <xsl:element name="xslt">
  1034. <!--<xsl:attribute name="basedir" select="$temp"/>-->
  1035. <xsl:attribute name="style" select="$builds_to_ant.xsl"/>
  1036. <xsl:attribute name="in" select="concat('${builds_to_ant.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1037. <!--<xsl:attribute name="destdir" select="$temp"/>-->
  1038. <xsl:attribute name="out" select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1039. <factory name="net.sf.saxon.TransformerFactoryImpl">
  1040. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  1041. <!--<attribute name="http://saxon.sf.net/feature/initialMode"
  1042. value="after_first_ant_assing_vars"/>-->
  1043. </factory>
  1044. <param name="temp" expression="{$temp}"/> <!-- TODO czy to zadziala @2017-04 -->
  1045. <param name="loop_xpath_real" expression="{$loop_xpath_real}{@xml_id}"/>
  1046. <param name="loop_path_recurs" expression="{$loop_path_recurs}"/>
  1047. <param name="loop_xpath" expression="{$loop_xpath}"/>
  1048. <param name="xpath_query_test.xml">
  1049. <xsl:attribute name="expression" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1050. </param>
  1051. <param name="build_check_java_process_count.xml" expression="{$build_check_java_process_count.xml}"/>
  1052. <param name="parallel_java_process_max" expression="{$parallel_java_process_max}"/>
  1053. <!--<param name="recurse_ant_basedir" expression="{$recurse_ant_basedir}"/>-->
  1054. <!--<xsl:element name="param">
  1055. <xsl:attribute name="name" select="'default_antfile'"/>
  1056. <xsl:attribute name="expression" select="concat($temp,'/',$builds_to_ant_file.xml"/>
  1057. </xsl:element>-->
  1058. <param name="default_antfile" expression="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml"/><!-- TODO czy to potrzebne? -->
  1059. <param name="xpath_query" expression="{$xpath_query}"/> <!-- limit related TODO -->
  1060. <!--<param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>-->
  1061. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  1062. <param name="ant-launcher.jar" expression="{$ant-launcher.jar}"/>
  1063. <param name="process_locks" expression="{$process_locks}"/>
  1064. <param name="uuid" expression="{$uuid}"/>
  1065. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  1066. </xsl:element>
  1067. <!-- delete tempfiles -->
  1068. <delete quiet="true">
  1069. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1070. </delete>
  1071. <delete quiet="true">
  1072. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1073. </delete>
  1074. <delete quiet="true">
  1075. <xsl:attribute name="file" select="concat('${builds_to_ant.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1076. </delete>
  1077. <delete quiet="true">
  1078. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1079. </delete>
  1080. <!--<ant antfile="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>-->
  1081. <xsl:element name="ant">
  1082. <xsl:attribute name="inheritall" select="'false'"/>
  1083. <xsl:attribute name="antfile" select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1084. </xsl:element>
  1085. <!-- running as java for safe maxfiles -->
  1086. <!--<java>
  1087. <xsl:attribute name="jar" select="$ant-launcher.jar"/>
  1088. <!-\-<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-\->
  1089. <!-\-<xsl:attribute name="dir" select="'${basedir}'"/>-\->
  1090. <xsl:attribute name="fork" select="'true'"/>
  1091. <xsl:attribute name="clonevm" select="'false'"/>
  1092. <xsl:attribute name="failonerror" select="'true'"/>
  1093. <!-\-<xsl:attribute name="append" select="'false'"/>-\->
  1094. <!-\-<xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>-\->
  1095. <!-\-<xsl:attribute name="output" select="concat($temp,'/',.,'_out.log')"/>-\->
  1096. <arg value="-buildfile"/>
  1097. <arg value="{$temp}/{$loop_xpath}/{.}/build.xml">
  1098. <xsl:attribute name="value" select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1099. </arg>
  1100. </java>-->
  1101. <delete quiet="true">
  1102. <xsl:attribute name="file" select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath_real,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'}')"/>
  1103. </delete>
  1104. <!--<ant antfile="{$temp}/${builds_to_ant_file.xml}" dir="."/>-->
  1105. <xsl:comment>end mode="place_subant" match="RelatedFeature"</xsl:comment>
  1106. </sequential>
  1107. </xsl:template>
  1108. <xsl:template mode="place_subant" match="RelatedFeatureLoop">
  1109. <xsl:param name="uuid" required="yes"/>
  1110. <xsl:param name="loop_xpath" required="yes"/>
  1111. <xsl:param name="loop_xpath_real" required="yes"/>
  1112. <xsl:param name="xpath_dita" required="yes"/>
  1113. <xsl:param name="xpath_value_dita" required="yes"/>
  1114. <xsl:param name="featureID_name_dita" required="yes"/>
  1115. <xsl:param name="loop_path_recurs_xpath" required="yes"/>
  1116. <xsl:param name="feature_pos_parent" required="yes"/> <!-- todo fixing conflict from parent leaf -->
  1117. <xsl:param name="feature_pos" required="yes"/>
  1118. <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
  1119. <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
  1120. <!-- wygenerujemy liste ant -->
  1121. <sequential>
  1122. <xsl:comment>
  1123. #590 LOOP BEGIN ; @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; </xsl:comment>
  1124. <xsl:if test="$debug &gt; 1"><echo>
  1125. $ $ $ $ $ #1001 match RelatedFeatureLoop mode place_subant $$$$$
  1126. $ #523 match RelatedFeatureLoop @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; ant bede odpalac w podkatalogu:@xml_id=(<xsl:value-of select="@xml_id"/>)
  1127. $ $featureID_name_dita= <xsl:value-of select="$featureID_name_dita"/>; $xpath_dita = <xsl:value-of select="$xpath_dita"/> $xpath_value_dita= <xsl:value-of select="$xpath_value_dita"/>
  1128. $ $feature_pos = <xsl:value-of select="$feature_pos"/>; $feature_pos_parent=<xsl:value-of select="$feature_pos_parent"/> ;
  1129. $ $loop_xpath = <xsl:value-of select="$loop_xpath"/>; $loop_path_recurs= <xsl:value-of select="$loop_path_recurs"/>;
  1130. $ loop_xpath_real = <xsl:value-of select="$loop_xpath_real"/> ;
  1131. $ przy FeatureLoop przy zapisie w (_1598 RelatedFeatureLoop jest okazja do zrobienia bilda /build_root.xml) $feature_pos_parent przechodzi w $feature_pos TUTAJ!
  1132. $ $temp = <xsl:value-of select="$temp"/> ;
  1133. $ position()= <xsl:value-of select="position()"/> ; $parallel_pos=<xsl:value-of select="$parallel_pos"/>; ($)parallel_pos=${parallel_pos} ;
  1134. </echo></xsl:if>
  1135. <xsl:if test="$debug &gt; 2"><xsl:message>#591 todo executing by exec instead of ant without inheritAll because it's looping!!! </xsl:message></xsl:if>
  1136. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  1137. <xsl:if test="$debug &gt; 2"><echo>#684 dajemy wpis o walidacji danego feature pod katem xpath_query $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; </echo></xsl:if>
  1138. <mkdir dir="{$temp}/{$loop_xpath}"/>
  1139. <!--<xsl:element name="tempfile">
  1140. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1141. <xsl:attribute name="deleteonexit" select="'no'"/>
  1142. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1143. <xsl:attribute name="suffix" select="'.xml'"/>
  1144. <xsl:attribute name="prefix" select="concat('.${uuid}.builds_to_ant-loop_test_featureID_name_dita',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$parallel_pos)"/>
  1145. </xsl:element>-->
  1146. <property>
  1147. <xsl:attribute name="name" select="concat('builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1148. <xsl:attribute name="location" select="concat($temp,'/',$loop_xpath,'/builds_to_ant-loop_test_featureID_name_dita_fixed_',@xml_id,'_',$feature_pos_parent,'_',$feature_pos,'_',$featureID_name_dita,$parallel_pos,'.xml')"/>
  1149. </property>
  1150. <!--<xsl:comment>#1067 secondary the same file </xsl:comment>-->
  1151. <!--<property>
  1152. <xsl:attribute name="name" select="concat('builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'_SECOND')"/>
  1153. <xsl:attribute name="location" select="concat($temp,'/',$loop_xpath,'/.builds_to_ant-loop_test_featureID_name_dita_fixed_',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,'.',$featureID_name_dita,$parallel_pos,'_SECOND.xml')"/>
  1154. </property>-->
  1155. <xsl:if test="$debug &gt; 2"><echo> #1056 fixed builds_to_ant-loop_test_featureID_name_dita_fixed: <xsl:value-of select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/> ; </echo></xsl:if>
  1156. <!-- <sleep>
  1157. <xsl:attribute name="milliseconds" select="concat($parallel_pos,'00')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  1158. </sleep>
  1159. <sleep>
  1160. <xsl:attribute name="milliseconds" select="concat('${parallel_pos}','00')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  1161. </sleep>-->
  1162. <!-- fixed file property test due error -->
  1163. <!--<xsl:element name="echoxml">
  1164. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1165. <EMPTY_FILE>NO_DATA</EMPTY_FILE>
  1166. </xsl:element>-->
  1167. <!-- second forced -->
  1168. <xsl:element name="echoxml">
  1169. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1170. <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/><xsl:attribute name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/></xsl:element>
  1171. </xsl:element>
  1172. <xsl:element name="tempfile">
  1173. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1174. <xsl:attribute name="deleteonexit" select="'no'"/>
  1175. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1176. <xsl:attribute name="suffix" select="'.xml'"/>
  1177. <xsl:attribute name="prefix" select="concat('.${uuid}.builds_to_ant-loop_test_featureID_name_dita_out',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1178. </xsl:element>
  1179. <!-- debug style! -->
  1180. <!--<xsl:element name="tempfile">
  1181. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_xpath.xsl',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1182. <xsl:attribute name="deleteonexit" select="'no'"/>
  1183. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1184. <xsl:attribute name="suffix" select="'.xsl'"/>
  1185. <xsl:attribute name="prefix" select="concat('.${uuid}.builds_to_ant-loop_test_featureID_name_xpath.xsl',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1186. </xsl:element>-->
  1187. <!--<copyfile src="{$xpath_query.xsl}">
  1188. <xsl:attribute name="dest" select="concat('${builds_to_ant__test_query__featureID_name_xpath.xsl',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1189. </copyfile>-->
  1190. <xsl:element name="echoxml">
  1191. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1192. <xpath_query_test>OK</xpath_query_test>
  1193. </xsl:element>
  1194. <!-- debug error ostatni /Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/default_db/recurse_ant/temp/PROCES_TREE_PID_0_20-1939_limit/d29821e1.1.PROCES_TREE/d29821e56852.10.PROCES_GROUP_1/d29821e63879.12.PROCES_INIT/d29821e63909.5.PROCES/.PROCES_TREE_PID_0_20-1939_limit.builds_to_ant-loop_test_featureID_name_ditad29821e63949.12.5863323145.xml -->
  1195. <!--<sleep>
  1196. <xsl:attribute name="milliseconds" select="concat($parallel_pos,'00')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  1197. </sleep>-->
  1198. <!--<sleep>
  1199. <xsl:attribute name="milliseconds" select="concat('${parallel_pos}','00')"/> <!-\- to sleep different time for each parallel task exec - ERROR -\->
  1200. </sleep>-->
  1201. <!--<waitfor >
  1202. <available >
  1203. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1204. </available>
  1205. </waitfor>-->
  1206. <xsl:if test="$debug &gt; 2"><echo>#1056 NOT processing $xpath_query.xsl in <xsl:value-of select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></echo></xsl:if>
  1207. <!--<exec executable="cat">
  1208. <arg><xsl:attribute name="line" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></arg>
  1209. </exec>-->
  1210. <!--<xsl:element name="xslt">
  1211. <!-\-<xsl:attribute name="basedir" select="concat($temp,'/',$loop_xpath)"/>-\->
  1212. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  1213. <xsl:attribute name="in" select="$empty.xml"/>
  1214. <!-\-<xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>-\->
  1215. <xsl:attribute name="out" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1216. <!-\-<xsl:attribute name="failOnError" select="'false'"/>-\-> <!-\- todo debug problems -\->
  1217. <!-\-<xsl:attribute name="failOnTransformationError" select="'false'"/>-\-> <!-\- todo debug problems -\->
  1218. <!-\-<xsl:attribute name="failOnNoResources" select="'false'"/>-\->
  1219. <xsl:attribute name="force" select="'true'"/>
  1220. <factory name="net.sf.saxon.TransformerFactoryImpl">
  1221. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  1222. <attribute name="http://saxon.sf.net/feature/initialTemplate" value="input"/>
  1223. </factory>
  1224. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  1225. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  1226. <param name="input">
  1227. <xsl:attribute name="expression" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1228. </param>
  1229. </xsl:element>-->
  1230. <!--<xsl:element name="xslt">
  1231. <!-\-<xsl:attribute name="basedir" select="concat($temp,'/',$loop_xpath)"/>-\->
  1232. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  1233. <xsl:attribute name="in" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1234. <!-\-<xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>-\->
  1235. <xsl:attribute name="out" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1236. <!-\-<xsl:attribute name="failOnError" select="'false'"/>-\-> <!-\- todo debug problems -\->
  1237. <!-\-<xsl:attribute name="failOnTransformationError" select="'false'"/>-\-> <!-\- todo debug problems -\->
  1238. <!-\-<xsl:attribute name="failOnNoResources" select="'false'"/>-\->
  1239. <xsl:attribute name="force" select="'true'"/>
  1240. <xsl:attribute name="reloadstylesheet" select="'true'"/>
  1241. <factory name="net.sf.saxon.TransformerFactoryImpl">
  1242. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  1243. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  1244. </factory>
  1245. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  1246. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  1247. </xsl:element>-->
  1248. <delete quiet="true">
  1249. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1250. </delete>
  1251. <!--<xsl:element name="xslt">
  1252. <xsl:attribute name="basedir" select="concat($temp,'/',$loop_xpath)"/>
  1253. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  1254. <xsl:attribute name="in" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1255. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1256. <xsl:attribute name="out" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1257. <!-\-<xsl:attribute name="failOnError" select="'false'"/>-\-> <!-\- todo debug problems -\->
  1258. <!-\-<xsl:attribute name="failOnTransformationError" select="'false'"/>-\-> <!-\- todo debug problems -\->
  1259. <!-\-<xsl:attribute name="failOnNoResources" select="'false'"/>-\->
  1260. <!-\-<xsl:attribute name="force" select="'true'"/>-\->
  1261. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  1262. </xsl:element>-->
  1263. <!-- DEBUG <loadfile>
  1264. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita.xml_loadfile',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita)"/>
  1265. <xsl:attribute name="srcfile" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,'}')"/>
  1266. </loadfile>
  1267. <echo>#1056 processing $xpath_query.xsl in <xsl:value-of select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,'}')"/>
  1268. FileContents: <xsl:value-of select="concat('${builds_to_ant__test_query__featureID_name_dita.xml_loadfile',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,'}')"/>
  1269. </echo>-->
  1270. <xsl:if test="$debug &gt; 1"><echo>#1071 EOF processing $xpath_query.xsl in <xsl:value-of select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></echo></xsl:if>
  1271. <!-- Lista do wyzwolenia dzieci w podkalagach na bazie params-->
  1272. <xsl:if test="$debug &gt; 1"><echo> #596 ant szukam dirset/fileset id=builds_to_ant w <xsl:value-of select="concat($temp,'/',$loop_xpath,'/',@xml_id,'.*/build_root.xml')"/></echo></xsl:if> <!-- loop path too long .',$featureID_name_dita,' -->
  1273. <dirset id="builds_to_ant{$loop_path_recurs}{$loop_xpath}{@xml_id}.{$feature_pos_parent}.{$feature_pos}{$featureID_name_dita}{$parallel_pos}" dir="{$temp}/{$loop_xpath}" includes="{@xml_id}.*" /> <!-- loop path too long .{$featureID_name_dita} -->
  1274. <property name="builds_to_ant{$loop_path_recurs}{$loop_xpath}{@xml_id}.{$feature_pos_parent}.{$feature_pos}{$featureID_name_dita}{$parallel_pos}" refid="builds_to_ant{$loop_path_recurs}{$loop_xpath}{@xml_id}.{$feature_pos_parent}.{$feature_pos}{$featureID_name_dita}{$parallel_pos}"/>
  1275. <!--<tempfile property="builds_to_ant.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.builds_to_ant-"/>-->
  1276. <xsl:element name="tempfile">
  1277. <xsl:attribute name="property" select="concat('builds_to_ant.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1278. <xsl:attribute name="deleteonexit" select="'no'"/>
  1279. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1280. <xsl:attribute name="suffix" select="'.xml'"/>
  1281. <xsl:attribute name="prefix" select="concat('.${uuid}.builds_to_ant-loop-',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1282. </xsl:element>
  1283. <!--<tempfile property="builds_to_ant_file.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.build_to_ant_file-"/>-->
  1284. <xsl:element name="tempfile">
  1285. <xsl:attribute name="property" select="concat('builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1286. <xsl:attribute name="deleteonexit" select="'no'"/>
  1287. <xsl:attribute name="destdir" select="concat($temp,'/',$loop_xpath)"/>
  1288. <xsl:attribute name="suffix" select="'.xml'"/>
  1289. <xsl:attribute name="prefix" select="concat('.${uuid}.build_to_ant_file-loop-',@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>
  1290. </xsl:element>
  1291. <xsl:if test="$debug &gt; 2"><echo>#615 ant do: builds_to_ant.xml=${builds_to_ant_file.xml} mode="place_subant" match="RelatedFeatureLoop" </echo></xsl:if>
  1292. <!--<echoxml file="'${builds_to_ant.xml}'"><builds_to_ant>${builds_to_ant}</builds_to_ant></echoxml>-->
  1293. <xsl:element name="echoxml">
  1294. <xsl:attribute name="file" select="concat('${builds_to_ant.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1295. <builds_to_ant>${builds_to_ant<xsl:value-of select="concat($loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos)"/>}</builds_to_ant>
  1296. </xsl:element>
  1297. <xsl:element name="xslt">
  1298. <xsl:attribute name="basedir" select="$temp"/>
  1299. <xsl:attribute name="style" select="$builds_to_ant.xsl"/>
  1300. <xsl:attribute name="in" select="concat('${builds_to_ant.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1301. <xsl:attribute name="destdir" select="$temp"/>
  1302. <xsl:attribute name="out" select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1303. <factory name="net.sf.saxon.TransformerFactoryImpl">
  1304. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  1305. <attribute name="http://saxon.sf.net/feature/initialMode" value="exec"/>
  1306. </factory>
  1307. <param name="temp" expression="{$temp}"/>
  1308. <param name="loop_xpath_real" expression="{$loop_xpath_real}{@xml_id}"/> <!-- TODO czy to jest potrzebne - raczej bledne - Testujemy dla unikalnosci zmiennych -->
  1309. <param name="loop_path_recurs" expression="{$loop_path_recurs}"/>
  1310. <param name="feature_pos" expression="{$feature_pos}"/>
  1311. <param name="feature_pos_parent" expression="{$feature_pos_parent}"/>
  1312. <param name="loop_xpath" expression="{$loop_xpath}"/>
  1313. <param name="xpath_query_test.xml">
  1314. <xsl:attribute name="expression" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1315. </param>
  1316. <!--<xsl:element name="param">
  1317. <xsl:attribute name="name" select="'default_antfile'"/>
  1318. <xsl:attribute name="expression" select="concat($temp,'/',$builds_to_ant_file.xml"/>
  1319. </xsl:element>-->
  1320. <param name="default_antfile" expression="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml"/> <!-- TODO czy to potrzebne raczej bledne -->
  1321. <param name="xpath_query" expression="{$xpath_query}"/>
  1322. <!--<param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>-->
  1323. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  1324. <param name="ant-launcher.jar" expression="{$ant-launcher.jar}"/>
  1325. <param name="build_check_java_process_count.xml" expression="{$build_check_java_process_count.xml}"/>
  1326. <param name="parallel_java_process_max" expression="{$parallel_java_process_max}"/>
  1327. <param name="process_locks" expression="{$process_locks}"/>
  1328. <param name="uuid" expression="{$uuid}"/>
  1329. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  1330. </xsl:element>
  1331. <xsl:if test="$debug &gt; 2"><echo> #1153 Loop executing antfile <xsl:value-of select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></echo></xsl:if>
  1332. <xsl:element name="ant">
  1333. <xsl:attribute name="inheritall" select="'false'"/>
  1334. <xsl:attribute name="antfile" select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/>
  1335. </xsl:element>
  1336. <!-- EOF Lista do wyzwolenia dzieci -->
  1337. <!--<exec command="/opt/local/bin/ant" dir="{$temp}" failifexecutionfails="true">
  1338. <!-\-<arg line="-f ${builds_to_ant_file.xml}"/>-\->
  1339. <xsl:element name="arg">
  1340. <xsl:attribute name="line" select="concat('-f ',@xml_id,'/',$uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/>
  1341. </xsl:element>
  1342. </exec>-->
  1343. <!--<xsl:element name="ant">
  1344. <xsl:attribute name="antfile" select="concat($temp,'/',@xml_id,'/',$uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/>
  1345. <xsl:attribute name="inheritAll" select="'false'"/>
  1346. <xsl:attribute name="inheritRefs" select="'false'"/>
  1347. <property name="xpath" value="{$xpath_dita}"/>
  1348. <property name="xpath_value_dita" value="{$xpath_value_dita}"/>
  1349. </xsl:element>-->
  1350. <!--<ant antfile="{$temp}/${builds_to_ant_file.xml}" dir="."/>-->
  1351. <xsl:comment>#590 LOOP END
  1352. </xsl:comment>
  1353. </sequential>
  1354. </xsl:template>
  1355. <xsl:template mode="place_subant" match="*">
  1356. <xsl:param name="uuid" required="yes"/>
  1357. <xsl:param name="loop_xpath" required="yes"/>
  1358. <xsl:param name="loop_xpath_real" required="yes"/>
  1359. <xsl:param name="xpath_dita" required="yes"/>
  1360. <xsl:param name="xpath_value_dita" required="yes"/>
  1361. <xsl:param name="featureID_name_dita" required="yes"/>
  1362. <xsl:param name="loop_path_recurs_xpath" required="yes"/>
  1363. <xsl:param name="feature_pos_parent" required="yes"/>
  1364. <xsl:param name="feature_pos" required="yes"/>
  1365. <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
  1366. <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
  1367. <xsl:apply-templates mode="place_subant">
  1368. <xsl:with-param name="uuid" select="$uuid"/>
  1369. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1370. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  1371. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  1372. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  1373. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  1374. <xsl:with-param name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/>
  1375. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
  1376. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  1377. <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
  1378. <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
  1379. </xsl:apply-templates>
  1380. </xsl:template>
  1381. <xsl:template mode="place_subant" match="text()|comment()"/>
  1382. <xsl:template name="xpath_filter_apply"> <!-- do przetworzenia filtra na podstawie danych wezla poprzedniego $input_obj_with_xpath oraz podanych parametrow @xpath i @xpath_value -->
  1383. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1384. <xsl:param name="xpath" required="yes"/>
  1385. <xsl:param name="xpath_value" required="yes"/>
  1386. <xsl:variable name="xpath_value_token">
  1387. <xsl:for-each select=" tokenize($xpath_value,'/')">
  1388. <xsl:if test="$debug &gt; 2"><xsl:message>#341 znalazlem dla=<xsl:value-of select="."/>; ; <xsl:value-of select="$input_obj_with_xpath/node()[@xpath=current()]"/></xsl:message></xsl:if>
  1389. <xsl:if test="$input_obj_with_xpath/node()[@xpath=current()]">
  1390. <xsl:copy-of select="$input_obj_with_xpath/node()[@xpath=current()]"/>
  1391. </xsl:if><!-- todo to jest bledne ale dziala tymczasowo-->
  1392. </xsl:for-each>
  1393. </xsl:variable>
  1394. <xsl:if test="$debug &gt; 2"><xsl:message>#345 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message></xsl:if>
  1395. <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
  1396. <xsl:value-of select="$xpath_value_token"/>
  1397. </xsl:template>
  1398. <xsl:template match="RelatedFeature" mode="ant_target" >
  1399. <xsl:param name="typeName_dita" required="yes"/>
  1400. <xsl:param name="featureID_name_dita" required="yes"/>
  1401. <xsl:param name="wfs_output" required="yes"/>
  1402. <xsl:param name="wfs_output.xml" required="yes"/>
  1403. <xsl:param name="wfs_output.dita" required="yes"/>
  1404. <xsl:param name="xpath_dita" required="yes"/>
  1405. <xsl:param name="xpath_value_dita" required="yes"/>
  1406. <xsl:param name="xpath" required="yes"/>
  1407. <xsl:param name="featureID_name" required="yes"/>
  1408. <xsl:param name="RelatedFeatureCount" required="yes"/>
  1409. <xsl:param name="RelatedFeaturePos" required="yes"/>
  1410. <xsl:param name="typeName" required="yes"/>
  1411. <xsl:param name="xpath_value" required="yes"/>
  1412. <xsl:param name="loop_xpath" required="yes"/>
  1413. <!--<xsl:param name="loop_xpath_save" required="yes"/>-->
  1414. <xsl:param name="xml_id" required="yes"/>
  1415. <xsl:param name="feature_pos" required="yes"/>
  1416. <xsl:param name="loop_xpath_real" required="yes"/>
  1417. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1418. <xsl:param name="typeNameRealResource" required="yes"/>
  1419. <xsl:param name="loop_path_recurs_xpath" required="yes"/>
  1420. <xsl:choose>
  1421. <xsl:when test="$wfs_output"/>
  1422. <xsl:otherwise><xsl:message terminate="yes">Not required param wfs_output - nazwa temp sciagniecia z api xml forsowana przez pierwsze sciagniecie - to set by next parraler step in ant build </xsl:message></xsl:otherwise>
  1423. </xsl:choose>
  1424. <!-- template do przetworzenia dity w celu wykrycia:
  1425. <RelatedFeature xpath="ID_BILLING_OWNER" typeName="p5_default_db:BILLING_OWNER">
  1426. <ph>Nadawca:</ph><br/>
  1427. <ph xpath="name1"/><br/>
  1428. <ph xpath="name2"/><br/>
  1429. <ph xpath="miasto"/><br/>
  1430. <ph xpath="nr_rach"/><br/>
  1431. <ph xpath="BILLING_OWNER_EMAIL"/><br/>
  1432. </RelatedFeature>
  1433. i wyrzucenia z tego pierwszego zadania ANT do otrzymania niezbednego .xml w celu jego podstawienia pod dite
  1434. w celu pozniejszego ponownego wyzwolenia tego template az do zakonczenia cyklu finalnego.
  1435. Template powinien budować projekt ant do wyzwolenia z odpowiednimi parametrami dalszymi
  1436. -->
  1437. <!-- sprawdzamy czy template pasuje do zadania wyzwolenia czy xpath=xpath_dita oraz czy typeName=typeName_dita-->
  1438. <xsl:choose>
  1439. <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 -->
  1440. <!-- 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'-->
  1441. <!--<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>-->
  1442. <!--<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>-->
  1443. <!--<xsl:variable name="OGC_Filter">
  1444. <xsl:choose>
  1445. <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>
  1446. <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>
  1447. </xsl:choose>
  1448. </xsl:variable>-->
  1449. <xsl:variable name="OGC_Filter">
  1450. <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
  1451. <xsl:with-param name="simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
  1452. <xsl:with-param name="RelatedFilter" select="RelatedFilter"/>
  1453. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  1454. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  1455. </xsl:call-template>
  1456. </xsl:variable>
  1457. <xsl:if test="$debug &gt; 2"><xsl:message>#410 final OGC_Filter is <xsl:value-of select="$OGC_Filter"/>;</xsl:message></xsl:if>
  1458. <xsl:variable name="url">
  1459. <!--<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"/>-->
  1460. <xsl:value-of select="$api_url"/>/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=<xsl:value-of select="$typeNameRealResource"/>&amp;SRSNAME=EPSG:3003<xsl:value-of select="$OGC_Filter"/>
  1461. </xsl:variable>
  1462. <xsl:element name="target">
  1463. <xsl:attribute name="name" select="concat('get_related_feature_test_if_output.xml.',position(),$loop_xpath_real)"/>
  1464. <xsl:attribute name="if" select="concat('${get_related_feature_test_if_output.xml.',position(),$loop_xpath_real,'}')"/>
  1465. <fail message="#1243 ERROR IN PROCESSING FUNCTION TO BE FIXED!! already created $wfs_output.xml {$temp}/{$wfs_output.xml} "/>
  1466. </xsl:element>
  1467. <xsl:element name="target">
  1468. <xsl:attribute name="name" select="concat('get_related_feature_test_if_vals.dita.',position(),$loop_xpath_real)"/>
  1469. <xsl:attribute name="if" select="concat('${get_related_feature_test_if_vals.dita.',position(),$loop_xpath_real,'}')"/>
  1470. <fail message="#1248 ERROR IN PROCESSING FUNCTION TO BE FIXED!! already created $wfs_output.dita {$temp}/{$wfs_output.dita} "/>
  1471. </xsl:element>
  1472. <xsl:element name="target">
  1473. <xsl:attribute name="name" select="concat('get_related_feature.',position(),$loop_xpath_real)"/>
  1474. <xsl:choose>
  1475. <xsl:when test="$RelatedFeatureCount=$RelatedFeaturePos"/>
  1476. <xsl:otherwise>
  1477. <xsl:attribute name="depends" select="concat('get_related_feature.',position()-1),$loop_xpath_real"/>
  1478. </xsl:otherwise>
  1479. </xsl:choose>
  1480. <xsl:if test="$debug &gt; 1"><echo>
  1481. ()()()()()()() $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/>
  1482. ()()()()()()() $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/>
  1483. ()()()()()()() #1084 exec curl for $typeNameRealResource=<xsl:value-of select="$typeNameRealResource"/>
  1484. ()()()()()()() $feature_pos = <xsl:value-of select="$feature_pos"/> ; position() = <xsl:value-of select="position()"/>; $parallel_pos = <xsl:value-of select="$parallel_pos"/> ;
  1485. ()()()()()()() and $xpath_dita=<xsl:value-of select="$xpath_dita"/>; $xpath_value=<xsl:value-of select="$xpath_value"/>; and $xpath_value_dita=<xsl:value-of select="$xpath_value_dita"/>;
  1486. ()()()()()()() $url=<xsl:value-of select="$url"/>;
  1487. ()()()()()()() $temp = <xsl:value-of select="$temp"/> ;
  1488. ()()()()()()() $loop_xpath_real = <xsl:value-of select="$loop_xpath_real"/>;
  1489. ()()()()()()() $loop_xpath = <xsl:value-of select="$loop_xpath"/>;
  1490. ()()()()()()() $wfs_output.xml = <xsl:value-of select="concat($temp,'/',$wfs_output.xml)"/>
  1491. ()()()()()()() oczekiwany $wfs_output.dita do przetworzenia nizej ( z result-document) = <xsl:value-of select="$wfs_output.dita"/> ;
  1492. </echo></xsl:if>
  1493. <condition> <!-- sprawdzenie czy jest juz przypadkiem wytworzony output - BLAD PRZETWARZANIA -->
  1494. <xsl:attribute name="taskname" select="concat('get_related_feature_test_if_output.xml.',position(),$loop_xpath_real)"/>
  1495. <xsl:attribute name="property" select="concat('get_related_feature_test_if_output.xml.',position(),$loop_xpath_real)"/>
  1496. <available>
  1497. <xsl:attribute name="file" select="concat($temp,'/',$wfs_output.xml)"/>
  1498. </available>
  1499. </condition>
  1500. <antcall> <!-- sprawdzenie czy jest juz przypadkiem wytworzony output - BLAD PRZETWARZANIA -->
  1501. <xsl:attribute name="target" select="concat('get_related_feature_test_if_output.xml.',position(),$loop_xpath_real)"/>
  1502. </antcall>
  1503. <!--<tempfile property="out_task.dita" deleteonexit="no" destdir="temp"/>-->
  1504. <!--<tempfile property="wfs_output" deleteonexit="no" destdir="temp" suffix=".xml" />-->
  1505. <ant antfile="{$get_wfs}" target="GetXmlByUrlVerifyRetry" >
  1506. <property name="output" value="{$temp}/{$wfs_output.xml}"/>
  1507. <property name="url" value="{$url}"/>
  1508. <property name="cookie_curl_option" value="{$cookie_curl_option}"/>
  1509. </ant>
  1510. <!--<xsl:element name="exec">
  1511. <xsl:attribute name="executable" select="'curl'"/>
  1512. <xsl:attribute name="output" select="concat($temp,'/',$wfs_output.xml)"/>
  1513. <xsl:attribute name="errorproperty" select="'wfs_error'"/>
  1514. <xsl:attribute name="resultproperty" select="'wfs_result'"/>
  1515. <xsl:element name="arg">
  1516. <!-\-<xsl:attribute name="line" select='concat("-H ","&amp;Authorization: Basic ",$passwordBase64Basic," ",$url)'/>-\->
  1517. <!-\-<xsl:attribute name="line">-H 'Authorization: Basic <xsl:value-of select="$passwordBase64Basic"/>' "<xsl:value-of select="$url"/>"</xsl:attribute>-\->
  1518. <xsl:attribute name="line"> <xsl:value-of select="$cookie_curl_option"/> "<xsl:value-of select="$url"/>"</xsl:attribute>
  1519. </xsl:element>
  1520. <xsl:element name="arg">
  1521. <xsl:attribute name="line">-\-connect-timeout 5</xsl:attribute>
  1522. </xsl:element>
  1523. <xsl:element name="arg">
  1524. <xsl:attribute name="line">-\-max-time 240</xsl:attribute>
  1525. </xsl:element>
  1526. <xsl:element name="arg">
  1527. <xsl:attribute name="line">-\-retry 5</xsl:attribute>
  1528. </xsl:element>
  1529. <xsl:element name="arg">
  1530. <xsl:attribute name="line">-\-retry-max-time 1200</xsl:attribute>
  1531. </xsl:element>
  1532. </xsl:element>-->
  1533. <xsl:choose>
  1534. <xsl:when test="position()=last()">
  1535. <xsl:comment>antcall target="build_recurse_ant.<xsl:value-of select="position()+1"/>.xml"</xsl:comment>
  1536. </xsl:when>
  1537. <xsl:otherwise>
  1538. <antcall target="build_recurse_ant.{position()+1}.xml"/>
  1539. </xsl:otherwise>
  1540. </xsl:choose>
  1541. <xsl:if test="$debug &gt; 1"><echo>#1119 related .dita.xml template is: $temp(/)$wfs_output.dita=<xsl:value-of select="$temp"/> (/) <xsl:value-of select="$wfs_output.dita"/>; do przetwarzania na podstawie: $wfs_output.xml=<xsl:value-of select="$wfs_output.xml"/>;
  1542. $temp is <xsl:value-of select="$temp"/>;</echo></xsl:if>
  1543. <xsl:comment> teraz podmieniamy dane z otrzymanego xmla do pliku dita aby potem zrobic polaczony plik w kolejnym wyzwoleniu ant</xsl:comment>
  1544. <!--<delete file="{$temp}/{$wfs_output.dita}.vals.dita"/> modified to condition test - shouldnt be before! -->
  1545. <!--<exec executable="ls">
  1546. <arg line="-al"/>
  1547. <arg><xsl:attribute name="line" select="concat($temp,'/',$wfs_output.xml)"/></arg>
  1548. </exec>-->
  1549. <condition> <!-- sprawdzenie czy jest juz przypadkiem wytworzony output - BLAD PRZETWARZANIA -->
  1550. <xsl:attribute name="taskname" select="concat('get_related_feature_test_if_vals.dita.',position(),$loop_xpath_real)"/>
  1551. <xsl:attribute name="property" select="concat('get_related_feature_test_if_vals.dita.',position(),$loop_xpath_real)"/>
  1552. <available >
  1553. <xsl:attribute name="file" select="concat($temp,'/',$wfs_output.dita)"/>
  1554. </available>
  1555. </condition>
  1556. <xslt basedir="." style="{$build_recurse_ant.xsl}" in="{$temp}/{$wfs_output.dita}" destdir="./" out="{$temp}/{$wfs_output.dita}.vals.dita" >
  1557. <factory name="net.sf.saxon.TransformerFactoryImpl">
  1558. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  1559. <attribute name="http://saxon.sf.net/feature/initialMode" value="after_first_ant_assing_vars"/>
  1560. </factory>
  1561. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  1562. <param name="wfs_output" expression="{$temp}/{$wfs_output.xml}"/>
  1563. <param name="xpath" expression="{$xpath}" /> <!-- kontrolnie - nie potrzebne -->
  1564. <param name="xpath_value" expression="{$xpath_value}" /> <!-- kontrolnie - nie potrzebne -->
  1565. <param name="loop_xpath" expression="{$loop_xpath}"/>
  1566. <param name="loop_xpath_save" expression="{$loop_xpath_save}"/>
  1567. <param name="typeName" expression="{$typeName}"/><!-- kontrolnie - nie potrzebne -->
  1568. <param name="uuid" expression="{$uuid}"/>
  1569. <param name="basedir" expression="{$basedir}"/>
  1570. <param name="recurse_ant_basedir" expression="{$recurse_ant_basedir}"/>
  1571. <param name="recurse_ant_basedir.temp" expression="{$recurse_ant_basedir.temp}"/>
  1572. <param name="recurse_ant" expression="{$recurse_ant}"/>
  1573. <param name="build_recurse_ant.xsl" expression="{$build_recurse_ant.xsl}"/>
  1574. <param name="passwordBase64Basic" expression="{$passwordBase64Basic}"/>
  1575. <param name="feature_pos" expression="{$feature_pos}"/> <!-- aby wsadzic nr wezla do $wfs_output.dita.vals.dita -->
  1576. <param name="temp" expression="{$temp}"/>
  1577. <param name="builds_to_ant.xsl" expression="{$builds_to_ant.xsl}"/>
  1578. <param name="cookie_curl_option" expression="{$cookie_curl_option}"/>
  1579. <param name="api_url" expression="{$api_url}"/>
  1580. <param name="loop_path_recurs" expression="{$loop_path_recurs}"/>
  1581. <param name="ignore_maxOccurs_0" expression="{$ignore_maxOccurs_0}"/>
  1582. <param name="xpath_query" expression="{$xpath_query}"/>
  1583. <param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>
  1584. <param name="empty.xml" expression="{$empty.xml}"/>
  1585. <param name="simpleSchema_dir" expression="{$simpleSchema_dir}"/>
  1586. <param name="default_db_xml_cache.public" expression="{$default_db_xml_cache.public}"/>
  1587. <param name="ant-launcher.jar" expression="{$ant-launcher.jar}"/>
  1588. <param name="loop_path_recurs_xpath" expression="{$loop_path_recurs_xpath}"/>
  1589. <param name="build_check_java_process_count.xml" expression="{$build_check_java_process_count.xml}"/>
  1590. <param name="parallel_java_process_max" expression="{$parallel_java_process_max}"/>
  1591. <param name="debug_xsl_in_filename" expression="{$temp}/{$wfs_output.dita}"/>
  1592. <param name="debug_xsl_out_filename" expression="{$temp}/{$wfs_output.dita}.vals.dita"/>
  1593. <param name="parallel_pos">
  1594. <xsl:attribute name="expression" select="'${parallel_pos}'"/>
  1595. </param>
  1596. <param name="process_locks" expression="{$process_locks}"/>
  1597. <param name="get_wfs" expression="{$get_wfs}"/>
  1598. </xslt>
  1599. </xsl:element>
  1600. <!-- zapisujemy wynik naszego biezacego przetwarzania dita element nizej do kolejnego przejechania z ant wyniku dla podstawienia danych -->
  1601. <!-- blad - result jest po tym template -->
  1602. <xsl:if test="$debug &gt; 2"><xsl:message> +++++ #276 $feature_pos=<xsl:value-of select="$feature_pos"/>; $xml_id=<xsl:value-of select="$xml_id"/>;
  1603. +++++ $temp is <xsl:value-of select="$temp"/> ;
  1604. +++++ writing $wfs_output.dita to <xsl:value-of select="$wfs_output.dita"/>;
  1605. +++++ $temp/$wfs_output.dita = <xsl:value-of select="concat($temp,'/',$wfs_output.dita)"/>
  1606. </xsl:message></xsl:if>
  1607. <!-- ten plik moze byc raz bo zawiera tylko mape do przeksztalcenia danego wezla -->
  1608. <xsl:result-document href="{$temp}/{$wfs_output.dita}">
  1609. <xsl:comment>current $feature_pos=<xsl:value-of select="$feature_pos"/>; $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:comment>
  1610. <!--<xsl:copy-of select="."/>-->
  1611. <xsl:element name="{name()}">
  1612. <xsl:copy-of select="@*"/>
  1613. <xsl:attribute name="feature_pos" select="$feature_pos"/>
  1614. <xsl:copy-of select="./*" exclude-result-prefixes="#all" copy-namespaces="no"/>
  1615. </xsl:element>
  1616. </xsl:result-document>
  1617. <!--<xsl:choose>
  1618. <xsl:when test="$feature_pos=1"><xsl:message>#327 propably first unaviable (<xsl:value-of select="$wfs_output.dita"/>) - writing</xsl:message>
  1619. <xsl:result-document href="{$wfs_output.dita}">
  1620. <xsl:comment>current $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:comment>
  1621. <xsl:copy-of select="."/></xsl:result-document>
  1622. </xsl:when>
  1623. <xsl:otherwise>
  1624. <xsl:message>#227.1 probably exists file:<xsl:value-of select="$wfs_output.dita"/>; - bypassing </xsl:message>
  1625. </xsl:otherwise>
  1626. </xsl:choose>-->
  1627. </xsl:when>
  1628. <xsl:otherwise>
  1629. <error>
  1630. <xsl:attribute name="xpath" select="$xpath"/>
  1631. <xsl:attribute name="xpath_dita" select="$xpath_dita"/>
  1632. <xsl:attribute name="xpath_value" select="$xpath_value"/>
  1633. <xsl:attribute name="xpath_value_dita" select="$xpath_value_dita"/>
  1634. <xsl:attribute name="typeName" select="$typeName"/>
  1635. <xsl:attribute name="typeName_dita" select="$typeName_dita"/>
  1636. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  1637. <xsl:attribute name="featureID_name_dita" select="$featureID_name_dita"/>
  1638. <echo message="OUTPUT__START"/>
  1639. <echo>
  1640. 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"/>)
  1641. </echo>
  1642. <echo message="OUTPUT__END"/>
  1643. </error>
  1644. </xsl:otherwise>
  1645. </xsl:choose>
  1646. </xsl:template>
  1647. <xsl:template name="simpleTypeMakeOgcFilter_merge"><!-- do zrobienia polaczonego filtru OGC -->
  1648. <xsl:param name="simpleTypeMakeOgcFilter" required="yes"/>
  1649. <xsl:param name="xpath_dita" required="yes"/>
  1650. <xsl:param name="xpath_value_dita" required="yes"/>
  1651. <xsl:param name="RelatedFilter"/>
  1652. <xsl:if test="$debug &gt; 2"><xsl:message>#1754 name="simpleTypeMakeOgcFilter_merge"
  1653. $simpleTypeMakeOgcFilter = <xsl:copy-of select="$simpleTypeMakeOgcFilter"></xsl:copy-of>
  1654. $xpath_dita = <xsl:copy-of select="$xpath_dita"/>
  1655. $xpath_value_dita = <xsl:copy-of select="$xpath_value_dita"/>
  1656. #EOF
  1657. </xsl:message>
  1658. </xsl:if>
  1659. <!--&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;<xsl:choose><xsl:when test="$RelatedFilter"><xsl:if test="$debug &gt; 2"><xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="$RelatedFilter" copy-namespaces="no"/></xsl:message></xsl:if>&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:if test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">&lt;ogc:Or&gt;</xsl:if><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 test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">&lt;/ogc:Or&gt;</xsl:if></xsl:if>&lt;/ogc:And&gt;&lt;/ogc:Filter&gt;-->
  1660. <!-- &amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;<xsl:choose>
  1661. <xsl:when test="$RelatedFilter"><xsl:if test="$debug &gt; 2">
  1662. <xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="$RelatedFilter" copy-namespaces="no"/></xsl:message>
  1663. </xsl:if>&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;
  1664. <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:if test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">&lt;ogc:Or&gt;</xsl:if>
  1665. <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;
  1666. <xsl:value-of select="ogc:Literal/text()"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:Or&gt;<xsl:if test="count($simpleTypeMakeOgcFilter/ogc:Or/ogc:PropertyIsEqualTo) &gt; 1">
  1667. &lt;/ogc:Or&gt;</xsl:if></xsl:if>&lt;/ogc:And&gt;&lt;/ogc:Filter&gt;
  1668. -->
  1669. <!--<RelatedFilter xpath="PARENT_ID" xpath_value=""/>-->
  1670. <xsl:value-of select="'&amp;Filter=&lt;ogc:Filter&gt;'"/>
  1671. <xsl:variable name="Filter">
  1672. <And>
  1673. <xsl:for-each select="$RelatedFilter">
  1674. <ogc:PropertyIsEqualTo>
  1675. <ogc:PropertyName><xsl:value-of select="@xpath"/></ogc:PropertyName>
  1676. <ogc:Literal><xsl:value-of select="@xpath_value"/></ogc:Literal>
  1677. </ogc:PropertyIsEqualTo>
  1678. </xsl:for-each>
  1679. <ogc:PropertyIsEqualTo>
  1680. <ogc:PropertyName><xsl:value-of select="$xpath_dita"/></ogc:PropertyName>
  1681. <ogc:Literal><xsl:value-of select="$xpath_value_dita"/></ogc:Literal>
  1682. </ogc:PropertyIsEqualTo>
  1683. <And>
  1684. <xsl:for-each select="$simpleTypeMakeOgcFilter/*">
  1685. <xsl:copy-of select="."/>
  1686. </xsl:for-each>
  1687. </And>
  1688. </And>
  1689. </xsl:variable>
  1690. <xsl:apply-templates select="$Filter" mode="simpleTypeMakeOgcFilter_merge_apply"/>
  1691. <xsl:value-of select="'&lt;/ogc:Filter&gt;'"/>
  1692. </xsl:template>
  1693. <xsl:template match="And" mode="simpleTypeMakeOgcFilter_merge_apply">
  1694. <xsl:choose>
  1695. <xsl:when test="child::node()">
  1696. <xsl:value-of select="'&lt;ogc:And&gt;'"/>
  1697. <xsl:apply-templates mode="simpleTypeMakeOgcFilter_merge_apply"/>
  1698. <xsl:value-of select="'&lt;/ogc:And&gt;'"/>
  1699. </xsl:when>
  1700. </xsl:choose>
  1701. </xsl:template>
  1702. <xsl:template match="*" mode="simpleTypeMakeOgcFilter_merge_apply" xpath-default-namespace="http://www.opengis.net/ogc">
  1703. <xsl:value-of select="concat('&lt;',name(),'&gt;')"/>
  1704. <xsl:apply-templates mode="simpleTypeMakeOgcFilter_merge_apply"/>
  1705. <xsl:value-of select="concat('&lt;/',name(),'&gt;')"/>
  1706. </xsl:template>
  1707. <xsl:template match="text()" mode="simpleTypeMakeOgcFilter_merge_apply">
  1708. <xsl:value-of select="."/>
  1709. </xsl:template>
  1710. <!-- second step from local ant leaf -->
  1711. <!-- wyzwalane przez http://saxon.sf.net/feature/initialMode w template match="RelatedFeature" mode ant_target ,
  1712. ktore jest wyzwalane w match="*" bez mode , ktore jest inicjowane przez niniejszy template w kolejnym wyzwoleniu
  1713. dostajemy na input {$temp}/{$wfs_output.dita} a na output {$temp}/{$wfs_output.dita}.vals.dita - co powinno zawierac podstawione zmienne z @xpath
  1714. nazwy z match="*" not(mode):
  1715. name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.xml')
  1716. name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.dita.xml')
  1717. -->
  1718. <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
  1719. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1720. <RelatedFeatureRoot>
  1721. <xsl:if test="$debug &gt; 2"><xsl:message>
  1722. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} #1348 after_first_ant_assing_vars @feature_pos=<xsl:value-of select="@feature_pos"/> &gt;$feature_pos_parent; @xml_id=<xsl:value-of select="@xml_id"/>; templ match RelatedFeature mode after_first_ant_assing_vars dla @typeName=<xsl:value-of select="@typeName"/>;
  1723. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} $debug_xsl_in_filename= <xsl:value-of select="$debug_xsl_in_filename"/>
  1724. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} $debug_xsl_out_filename= <xsl:value-of select="$debug_xsl_out_filename"/>
  1725. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} try to open $wfs_output=doc(<xsl:value-of select="$wfs_output"/>); </xsl:message></xsl:if>
  1726. <!-- first assign xpath to features from -->
  1727. <xsl:variable name="wfs_output_nodes" select="doc($wfs_output)"/>
  1728. <xsl:variable name="current_RelatedFeature" select="*"/>
  1729. <xsl:variable name="xml_id" select="@xml_id"/>
  1730. <xsl:variable name="feature_pos_parent" select="@feature_pos"/>
  1731. <!--<input_obj_with_xpath_debug>
  1732. <xsl:copy-of select="$wfs_output_nodes"/>
  1733. </input_obj_with_xpath_debug>-->
  1734. <xsl:if test="$debug &gt; 2"><xsl:message>
  1735. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} #354 count($wfs_output_nodes//gml:featureMember) <xsl:value-of select="count($wfs_output_nodes//gml:featureMember)"/></xsl:message></xsl:if>
  1736. <!-- tutaj jest blad przetwarzania ze wrzuca po rekordzie do kolumny - trzeba przetworzyc dla kazdego feature member -->
  1737. <xsl:for-each select="$wfs_output_nodes//gml:featureMember">
  1738. <xsl:if test="$debug &gt; 2"><xsl:message>
  1739. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} #1466 foreach from $wfs_output=<xsl:value-of select="$wfs_output"/>
  1740. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} @fid=<xsl:value-of select="*/@fid"/>; position()=<xsl:value-of select="position()"/>; </xsl:message></xsl:if>
  1741. <xsl:variable name="input_obj_with_xpath">
  1742. <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -->
  1743. </xsl:variable>
  1744. <!--<input_obj_with_xpath_debug>
  1745. <xsl:attribute name="xpath" select="$xpath"/>
  1746. <!-\-<xsl:attribute name="xpath_dita" select="$xpath_dita"/>-\->
  1747. <xsl:attribute name="xpath_value" select="$xpath_value"/>
  1748. <!-\-<xsl:attribute name="xpath_value_dita" select="$xpath_value_dita"/>-\->
  1749. <xsl:attribute name="typeName" select="$typeName"/>
  1750. <!-\-<xsl:attribute name="typeName_dita" select="$typeName_dita"/>-\->
  1751. <!-\-<xsl:attribute name="featureID_name" select="$featureID_name"/>-\->
  1752. <!-\-<xsl:attribute name="featureID_name_dita" select="$featureID_name_dita"/>-\->
  1753. <xsl:copy-of select="$input_obj_with_xpath"/>
  1754. </input_obj_with_xpath_debug>-->
  1755. <!--<input_node_debug>
  1756. <xsl:copy-of select="."/>
  1757. </input_node_debug>-->
  1758. <xsl:apply-templates mode="after_first_ant_assing_vars_childs" select="$current_RelatedFeature">
  1759. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  1760. <xsl:with-param name="xml_id_parent" select="$xml_id"/>
  1761. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1762. <xsl:with-param name="feature_pos" select="position()"/><!-- wiecej features z relacji dokladamy pozycje -->
  1763. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/> <!-- @2017-04 byly nadpisywane informacje - trzeba dorzucic jeszcze $feature_pos_parent w nazwie przetwarzania -->
  1764. </xsl:apply-templates>
  1765. </xsl:for-each>
  1766. <xsl:if test="$debug &gt; 2"><xsl:message>
  1767. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} #1499 EOF foreach from #1466 from $wfs_output=<xsl:value-of select="$wfs_output"/></xsl:message></xsl:if>
  1768. </RelatedFeatureRoot>
  1769. </xsl:template>
  1770. <xsl:template match="wfs:FeatureCollection|gml:featureMember" mode="after_first_ant_assing_xpath">
  1771. <xsl:apply-templates mode="after_first_ant_assing_xpath"/>
  1772. </xsl:template>
  1773. <xsl:template mode="after_first_ant_assing_xpath" match="*">
  1774. <xsl:param name="curr_xpath"/>
  1775. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1776. <xsl:choose>
  1777. <xsl:when test="name()=$typeName">
  1778. <xsl:apply-templates mode="after_first_ant_assing_xpath">
  1779. <xsl:with-param name="curr_xpath" select="$curr_xpath"/>
  1780. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1781. </xsl:apply-templates>
  1782. </xsl:when>
  1783. <xsl:otherwise>
  1784. <xsl:variable name="curr_xpath_tmpl">
  1785. <xsl:choose>
  1786. <xsl:when test="$curr_xpath=''">
  1787. <xsl:value-of select="local-name()"/> <!-- bylo local-name() - trzeba dorzucic xpath przechodzacy aby budowal sie w kwestii -->
  1788. </xsl:when>
  1789. <xsl:otherwise>
  1790. <xsl:value-of select="concat($curr_xpath,'/',local-name())"/>
  1791. </xsl:otherwise>
  1792. </xsl:choose>
  1793. </xsl:variable>
  1794. <!--<xsl:variable name="curr_xpath_tmpl" select="'asdf'"/>-->
  1795. <xsl:element name="{name()}">
  1796. <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
  1797. <xsl:for-each select="@*">
  1798. <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
  1799. </xsl:for-each>
  1800. <xsl:value-of select="text()"/>
  1801. <xsl:apply-templates mode="after_first_ant_assing_xpath">
  1802. <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
  1803. </xsl:apply-templates>
  1804. </xsl:element>
  1805. </xsl:otherwise>
  1806. </xsl:choose>
  1807. </xsl:template>
  1808. <xsl:template match="text()" mode="after_first_ant_assing_xpath"/>
  1809. <xsl:template match="simpleTypeMakeOgcFilter" mode="after_first_ant_assing_vars_childs">
  1810. <xsl:if test="$debug &gt; 2"><xsl:message>#621 bypassing simpleTypeMakeOgcFilter in after_first_ant_assing_vars_childs</xsl:message></xsl:if>
  1811. </xsl:template>
  1812. <!-- przetwarzanie kolejne w celu podstawienia wartosci i wystawienia build dla kolejnych wezlow - problem z obsluga rownorzednie zagniezdzonych wezlow poprzez inne wezly -->
  1813. <xsl:template match="*" mode="after_first_ant_assing_vars_childs">
  1814. <xsl:param name="xml_id_parent" required="yes"/>
  1815. <xsl:param name="loop_xpath" required="yes"/>
  1816. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1817. <xsl:param name="feature_pos" required="yes"/>
  1818. <xsl:param name="feature_pos_parent" required="yes"/>
  1819. <xsl:for-each select=".">
  1820. <xsl:choose>
  1821. <!--<xsl:when test="node()='topic'">asdad</xsl:when>-->
  1822. <!--<xsl:when test="name()='RelatedFeature'">
  1823. <xsl:for-each select="data/apiname[@base='PROCES_INCLUDE']">
  1824. <xsl:apply-templates mode="PROCES_INCLUDE">
  1825. <xsl:with-param name="ID_PROCES" select="text()"/>
  1826. </xsl:apply-templates>
  1827. </xsl:for-each>
  1828. </xsl:when>-->
  1829. <!--<xsl:when test="name()='data-about'">
  1830. <xsl:for-each select="data/apiname[@base='PROCES_INCLUDE']">
  1831. <xsl:apply-templates mode="PROCES_INCLUDE">
  1832. <xsl:with-param name="ID_PROCES" select="text()"/>
  1833. </xsl:apply-templates>
  1834. </xsl:for-each>
  1835. </xsl:when>-->
  1836. <xsl:when test="1=2"/>
  1837. <xsl:otherwise>
  1838. <xsl:element name="{name()}">
  1839. <!--<xsl:copy-of select="namespace::node()"/>-->
  1840. <xsl:for-each select="@*">
  1841. <xsl:choose>
  1842. <xsl:when test="name()='xpath'">
  1843. <!--<xsl:attribute name="xpath_parsed" select="."/>-->
  1844. <!--1:<xsl:value-of select="$parent_obj//node()[@system_cache__appinfo:xpath=$xpath]/text()"/>-->
  1845. <!--<xsl:value-of select="$parent_obj//node()[local-name()=$xpath]/text()"/>-->
  1846. <!--V:<xsl:value-of select="$xpath"/>-->
  1847. </xsl:when>
  1848. <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
  1849. </xsl:choose>
  1850. </xsl:for-each>
  1851. <xsl:choose>
  1852. <xsl:when test="@xpath">
  1853. <!--<xsl:variable name="escaped_html_to_xml">
  1854. <xsl:call-template name="system_cache__appinfo:escaped_html_to_xml">
  1855. <xsl:with-param name="html" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
  1856. </xsl:call-template>
  1857. </xsl:variable>-->
  1858. <!--<xsl:variable name="enter_to_ph">
  1859. <xsl:apply-templates mode="enter_to_ph" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]">
  1860. <xsl:with-param name="count" select="count($input_obj_with_xpath/node()[local-name()=current()/@xpath])"/>
  1861. <xsl:with-param name="element" select="name()"/>
  1862. <!-\-<xsl:with-param name="xpath_token_filter" select="@xpath_token_filter"/>-\-><!-\- mozliwosc wybrania pierwszego wyrazu np ' ' -\->
  1863. <!-\-<xsl:with-param name="xpath_token" select="@xpath_token"/>-\-><!-\- mozliwosc wybrania pierwszego wyrazu np 1 -\->
  1864. </xsl:apply-templates>
  1865. </xsl:variable>-->
  1866. <xsl:variable name="enter_to_ph">
  1867. <xsl:choose>
  1868. <xsl:when test="@xpath_token_filter and @xpath_token ">
  1869. <!-- implementacja filtra dla czegos oddzielonego parametrem -->
  1870. <xsl:variable name="xpath_token_filter" select="tokenize($input_obj_with_xpath/node()[local-name()=current()/@xpath],@xpath_token_filter)"/>
  1871. <xsl:for-each select=" tokenize(@xpath_token,' ')">
  1872. <xsl:variable name="xpath_token" select="number(.)"/>
  1873. <xsl:copy-of select="$xpath_token_filter[$xpath_token]"></xsl:copy-of>
  1874. </xsl:for-each>
  1875. </xsl:when>
  1876. <xsl:when test="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/*">
  1877. <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/*"/>
  1878. </xsl:when>
  1879. <xsl:otherwise>
  1880. <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
  1881. </xsl:otherwise>
  1882. </xsl:choose>
  1883. </xsl:variable>
  1884. <xsl:copy-of select="$enter_to_ph"/>
  1885. </xsl:when>
  1886. </xsl:choose>
  1887. <!--<xsl:comment>#1938 value of text()</xsl:comment>-->
  1888. <xsl:value-of select="text()"/>
  1889. <xsl:apply-templates mode="after_first_ant_assing_vars_childs">
  1890. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  1891. <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
  1892. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1893. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  1894. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
  1895. </xsl:apply-templates>
  1896. </xsl:element>
  1897. </xsl:otherwise>
  1898. </xsl:choose>
  1899. </xsl:for-each>
  1900. </xsl:template>
  1901. <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars_childs">
  1902. <xsl:if test="$debug &gt; 2"><xsl:message>#1638 ignored @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; @typeName=<xsl:value-of select="@typeName"/>; @xml_id=<xsl:value-of select="@xml_id"/>; </xsl:message></xsl:if>
  1903. </xsl:template> <!-- to disable ignored maxOccurs=0 -->
  1904. <xsl:template match="RelatedFeature[not(@system_cache__appinfo:maxOccurs='0') or not($ignore_maxOccurs_0)]" mode="after_first_ant_assing_vars_childs">
  1905. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1906. <xsl:param name="xml_id_parent" required="yes"/>
  1907. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1908. <xsl:param name="feature_pos" required="yes"/>
  1909. <xsl:param name="feature_pos_parent" required="yes"/>
  1910. <xsl:if test="$debug &gt; 2"><xsl:message>#411 $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></xsl:if>
  1911. <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
  1912. <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
  1913. <xsl:variable name="xml_id" select="@xml_id"/>
  1914. <xsl:variable name="loop_xpath" select="concat($loop_xpath,'/',$xml_id,'.',$feature_pos)"/> <!-- loop path too long ,'.',$featureID_name -->
  1915. <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
  1916. <!--<debug_358_RelatedFeature>
  1917. <xsl:copy-of select="$input_obj_with_xpath"/>
  1918. </debug_358_RelatedFeature>-->
  1919. <!--<xsl:variable name="feature_pos">
  1920. <xsl:choose>
  1921. <xsl:when test="$feature_pos=1"/>
  1922. <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
  1923. </xsl:choose>
  1924. </xsl:variable>-->
  1925. <xsl:variable name="test_xpath_query">
  1926. <xsl:call-template name="test_xpath_query">
  1927. <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
  1928. <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
  1929. <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
  1930. <xsl:with-param name="xpath_query" select="$xpath_query"/>
  1931. </xsl:call-template>
  1932. </xsl:variable>
  1933. <xsl:choose>
  1934. <xsl:when test="$test_xpath_query='1'">
  1935. <xsl:if test="$debug &gt; 2"><xsl:message>[][][][][]\/\/\/\/\/\/\/\/\/\/\/ #1540 jest okazja do zrobienia bilda $feature_pos_parent = <xsl:value-of select="$feature_pos_parent"/> ; $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"/>; match=RelatedFeature mode=after_first_ant_assing_vars_childs </xsl:message></xsl:if>
  1936. <xsl:if test="$debug &gt; 2"><xsl:message>[][][][][]\/\/\/\/\/\/\/\/\/\/\/ #1541 WRITING RelatedFeature to <xsl:value-of select="concat($temp,'/',$loop_xpath,'/build.xml')"/> ; \/\/\/\/\/\/\/\/\/\/[][][][][][][][] </xsl:message></xsl:if>
  1937. <xsl:choose>
  1938. <xsl:when test=" doc-available(concat($temp,'/',$loop_xpath,'/build.xml'))"> <!-- bylo : doc-available(concat($temp,'/',$uuid,'.build_',$loop_xpath,'.',$feature_pos_parent,'.',$feature_pos,'.xml')) zmieniamy strukture przetwarzania add $feature_pos_parent -->
  1939. <xsl:message terminate="yes">[][][][][]\/\/\/\/\/\/\/\/\/\/\/ ERROR ERROR previous file exists - SOME ERROR IN LEAF PROCESSING OCCURED! </xsl:message>
  1940. </xsl:when>
  1941. <xsl:otherwise>
  1942. <xsl:if test="$debug &gt; 2"><xsl:message>[][][][][]\/\/\/\/\/\/\/\/\/\/\/ OK no previous file exists ;-) </xsl:message></xsl:if>
  1943. </xsl:otherwise>
  1944. </xsl:choose>
  1945. <xsl:result-document href="{$temp}/{$loop_xpath}/build.xml">
  1946. <xsl:apply-templates select=".">
  1947. <xsl:with-param name="typeName" select="@typeName"/>
  1948. <xsl:with-param name="xpath" select="@xpath"/>
  1949. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  1950. <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
  1951. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  1952. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1953. <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
  1954. <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
  1955. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  1956. <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
  1957. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
  1958. <!--<xsl:with-param name="wfs_output.xml" />-->
  1959. </xsl:apply-templates>
  1960. </xsl:result-document>
  1961. <xsl:element name="RelatedFeature">
  1962. <xsl:copy-of select="@*"/>
  1963. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  1964. <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
  1965. <xsl:attribute name="feature_pos" select="$feature_pos"/>
  1966. <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/>
  1967. </xsl:element>
  1968. </xsl:when>
  1969. <xsl:otherwise>
  1970. <xsl:if test="$debug &gt; 2"><xsl:message terminate="no">#389b
  1971. #
  1972. #
  1973. #
  1974. BYPASSED BY $test_xpath_query=<xsl:value-of select="$test_xpath_query"/>; 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
  1975. #
  1976. #</xsl:message></xsl:if>
  1977. </xsl:otherwise>
  1978. </xsl:choose>
  1979. </xsl:template>
  1980. <xsl:template match="RelatedFeatureLoop" mode="after_first_ant_assing_vars_childs">
  1981. <xsl:if test="$debug &gt; 2"><xsl:message>#1718 ignored @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; @typeName=<xsl:value-of select="@typeName"/>; @xml_id=<xsl:value-of select="@xml_id"/>; </xsl:message></xsl:if>
  1982. </xsl:template>
  1983. <xsl:template match="RelatedFeatureLoop[not(@system_cache__appinfo:maxOccurs='0') or not($ignore_maxOccurs_0)]" mode="after_first_ant_assing_vars_childs">
  1984. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1985. <xsl:param name="xml_id_parent" required="yes"/>
  1986. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1987. <xsl:param name="feature_pos" required="yes"/>
  1988. <xsl:param name="feature_pos_parent" required="yes"/>
  1989. <xsl:if test="$debug &gt; 2"><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></xsl:if>
  1990. <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
  1991. <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
  1992. <xsl:variable name="xml_id" select="@xml_id"/>
  1993. <xsl:variable name="loop_xpath" select="concat($loop_xpath,'/',$xml_id,'.',$feature_pos)"/><!-- limit path ,'.',$featureID_name -->
  1994. <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
  1995. <!--<debug_358_RelatedFeature>
  1996. <xsl:copy-of select="$input_obj_with_xpath"/>
  1997. </debug_358_RelatedFeature>-->
  1998. <!--<xsl:variable name="feature_pos">
  1999. <xsl:choose>
  2000. <xsl:when test="$feature_pos=1"/>
  2001. <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
  2002. </xsl:choose>
  2003. </xsl:variable>-->
  2004. <xsl:variable name="loop_path_recurs">
  2005. <xsl:choose>
  2006. <xsl:when test=" string-length($loop_path_recurs) &lt;1">
  2007. <xsl:value-of select="concat('/',$loop_xpath)"/> <!-- bylo $feature_pos , concat('/',@xml_id,'.',$uuid,'.',$feature_pos_parent,'.',$feature_pos) -->
  2008. </xsl:when>
  2009. <xsl:otherwise><xsl:value-of select="concat($loop_path_recurs,'/',$loop_xpath)"/></xsl:otherwise>
  2010. </xsl:choose>
  2011. </xsl:variable>
  2012. <xsl:if test="$debug &gt; 2"><xsl:message>
  2013. \/\/\/\/\/\/\/\/\/\/\/ #1598 RelatedFeatureLoop jest okazja do zrobienia bilda $feature_pos_parent=<xsl:value-of select="$feature_pos_parent"/> $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"/>; match=RelatedFeature mode=after_first_ant_assing_vars_childs
  2014. \/\/\/\/\/\/\/\/\/\/\/ $debug_xsl_in_filename= <xsl:value-of select="$debug_xsl_in_filename"/>
  2015. \/\/\/\/\/\/\/\/\/\/\/ $debug_xsl_out_filename= <xsl:value-of select="$debug_xsl_out_filename"/>
  2016. \/\/\/\/\/\/\/\/\/\/\/ @fid=<xsl:value-of select="*/@fid"/>; position()=<xsl:value-of select="position()"/>;
  2017. \/\/\/\/\/\/\/\/\/\/\/ to <xsl:value-of select="concat($temp,'/',$loop_xpath,'/build_root.xml')"/></xsl:message></xsl:if>
  2018. <xsl:variable name="test_xpath_query">
  2019. <xsl:call-template name="test_xpath_query">
  2020. <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
  2021. <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
  2022. <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
  2023. <xsl:with-param name="xpath_query" select="$xpath_query"/>
  2024. </xsl:call-template>
  2025. </xsl:variable>
  2026. <xsl:choose>
  2027. <xsl:when test="$test_xpath_query='1'">
  2028. <xsl:choose>
  2029. <xsl:when test=" doc-available(concat($temp,'/',$loop_xpath,'/build_root.xml'))">
  2030. <xsl:message terminate="yes">/\/\/\/\/\/\/ #1687 ERRROR is already created <xsl:value-of select="concat($temp,'/',$loop_xpath,'/build_root.xml')"/> PROBLEM IN PROCESSING TO BE FIXED IN ENGINE!!! </xsl:message>
  2031. </xsl:when>
  2032. <xsl:otherwise>
  2033. <xsl:if test="$debug &gt; 2"><xsl:message>\/\/\/\/\/\/\/\/\/\/\/ 1615 WRITING RelatedFeatureLoop to <xsl:value-of select="concat($temp,'/',$loop_xpath,'/build_root.xml')"/> ; \/\/\/\/\/\/\/\/\/\/ </xsl:message></xsl:if>
  2034. <xsl:result-document href="{$temp}/{$loop_xpath}/build_root.xml" >
  2035. <xsl:apply-templates select=".">
  2036. <xsl:with-param name="typeName" select="@typeName"/>
  2037. <xsl:with-param name="xpath" select="@xpath"/>
  2038. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  2039. <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
  2040. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  2041. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  2042. <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" /><!-- Not used TODO disable -->
  2043. <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
  2044. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  2045. <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
  2046. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
  2047. <!--<xsl:with-param name="wfs_output.xml" />-->
  2048. </xsl:apply-templates>
  2049. </xsl:result-document>
  2050. <xsl:element name="RelatedFeatureLoop">
  2051. <xsl:copy-of select="@*"/>
  2052. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  2053. <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
  2054. <xsl:attribute name="loop_path_recurs" select="$loop_path_recurs"/>
  2055. <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/> <!-- TODO nie wiemy czy to tu bedzie potrzebne @2017-04 byly nadpisywane informacje - trzeba dorzucic jeszcze $feature_pos_parent w nazwie przetwarzania -->
  2056. </xsl:element>
  2057. </xsl:otherwise>
  2058. </xsl:choose>
  2059. </xsl:when>
  2060. <xsl:otherwise>
  2061. <xsl:if test="$debug &gt; 2"><xsl:message terminate="no">#1263
  2062. #
  2063. #
  2064. #
  2065. BYPASSED BY $test_xpath_query=<xsl:value-of select="$test_xpath_query"/>; 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
  2066. #
  2067. #</xsl:message></xsl:if>
  2068. </xsl:otherwise>
  2069. </xsl:choose>
  2070. </xsl:template>
  2071. <xsl:template match="text()" mode="after_first_ant_assing_vars_childs"/>
  2072. <xsl:template match="comment()" mode="after_first_ant_assing_vars_childs"/>
  2073. <!-- pozbieranie do kupy wszystkich xmli i zlozenie dity -->
  2074. <xsl:template name="test_xpath_query">
  2075. <!-- to verify if retrieve some node based on user requested tree limit filter -->
  2076. <xsl:param name="ignore_maxOccurs_0" required="yes"/>
  2077. <xsl:param name="xpath_query" required="yes"/>
  2078. <xsl:param name="featureID_name_dita" required="yes"/>
  2079. <xsl:param name="system_cache__appinfo:maxOccurs" required="yes"/>
  2080. <xsl:if test="$debug &gt; 2"><xsl:message>#1290 $system_cache__appinfo:maxOccurs=<xsl:value-of select="$system_cache__appinfo:maxOccurs"/>; $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; $xpath_query=<xsl:value-of select="$xpath_query"/>; </xsl:message></xsl:if>
  2081. <xsl:if test="$ignore_maxOccurs_0"><xsl:if test="$debug &gt; 2"><xsl:message terminate="no">#1344 test igrnore is true()=<xsl:value-of select="$ignore_maxOccurs_0"/>;</xsl:message></xsl:if></xsl:if>
  2082. <xsl:variable name="TestMaxOccurs">
  2083. <xsl:choose>
  2084. <xsl:when test="$system_cache__appinfo:maxOccurs='0' and $ignore_maxOccurs_0"></xsl:when>
  2085. <xsl:otherwise>1</xsl:otherwise>
  2086. </xsl:choose>
  2087. </xsl:variable>
  2088. <xsl:value-of select="$TestMaxOccurs"/>
  2089. </xsl:template>
  2090. </xsl:stylesheet>