build_recurse_ant.xsl 186 KB

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