build_recurse_ant.xsl 193 KB

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