build_recurse_ant.xsl 193 KB

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