build_recurse_ant.xsl 121 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:gml="http://www.opengis.net/gml"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xmlns:xlink="http://www.w3.org/1999/xlink"
  7. xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
  8. xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
  9. xmlns:wfs="http://www.opengis.net/wfs"
  10. xmlns:ogc="http://www.opengis.net/ogc"
  11. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  12. xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
  13. exclude-result-prefixes="xs"
  14. version="2.0">
  15. <xsl:output indent="yes" />
  16. <xsl:strip-space elements="*"/>
  17. <!-- Copyright BIALL-NET sp. z o.o. 2017-03-01 by Arkadiusz Binder wszelkie prawa zastrzeżone -->
  18. <!-- @2017-03-01 modyfikacja dla potrzeb CRM_PROCES_tree - sa bledy-->
  19. <xsl:include href="escaped_html_to_xml.xsl"/>
  20. <!--
  21. <property name="url" value="${url}"/> - to point what is record/table to download
  22. <property name="uuid" value="${uuid}"/> it is automatically also set to enable uinque transaction and to allow to save data with user
  23. <property name="passwordBase64Basic" value="${passwordBase64Basic}"/> - this is also set - to enable communicate with API -
  24. <property name="DwebRootUrl" value="${$webRootUrl}"/> - this is the place where script is localized to easyli to target user GUI by href to generated output -->
  25. <!-- variables to be set first by GUI first_request from executing API (php -> bash)-->
  26. <xsl:param name="uuid" required="yes" /> <!-- pewnie bedziemy ignorowac i dzialac na bazie ${'wfs_output'} ktory juz jest tempfilem -->
  27. <xsl:param name="passwordBase64Basic" required="yes" />
  28. <xsl:param name="url" />
  29. <xsl:param name="webRootUrl" />
  30. <xsl:param name="basedir" required="yes"/> <!-- aktualny katalog gdzie znajduja sie pliki temp -->
  31. <xsl:param name="recurse_ant_basedir" required="yes"/> <!-- aktualny katalog gdzie znajduja sie pliki temp -->
  32. <xsl:param name="recurse_ant_basedir.temp" required="yes"/>
  33. <xsl:param name="recurse_ant" required="yes"/>
  34. <!--<xsl:param name="out_task.dita"/>--> <!-- nazwa temp docelowego zrodla do wykonania pliku pdf -->
  35. <!--<xsl:param name="current_leaf.dita" required="yes"/>--> <!-- nazwa aktualnego przetowarzenia .dita - najpierw main_build_recurse_ant.dita potem przechodzi w 1.1.root_x2f_IN7_DZIENNIK_KORESP.1.dita.xml -->
  36. <!--<xsl:param name="wfs_output" select="concat('temp/wfs_output.',$uuid)"/>-->
  37. <!-- jak parametr jest to znaczy, ze przetwarzamy -->
  38. <xsl:param name="wfs_output" required="no"/> <!-- potem wfs_output.xml jak sciagnie nazwa temp sciagniecia z api xml forsowana przez pierwsze sciagniecie -->
  39. <xsl:param name="api_url" required="yes"/>
  40. <!--<xsl:param name="namespace_prefix" select="'p5_default_db'"/>-->
  41. <xsl:param name="typeName" required="yes" /> <!-- to be set initially ex: p5_default_db:IN7_DZIENNIK_KORESP -->
  42. <xsl:param name="xpath" required="yes" /> <!-- to be set initially ex: ID -->
  43. <xsl:param name="xpath_value" required="yes" /> <!-- to be set ex: 1000 -->
  44. <xsl:param name="loop_xpath" required="yes"/> <!-- sciezka do zapisywania xmli w przetwarzaniu plikow default root -->
  45. <xsl:param name="loop_xpath_save" required="yes"/> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
  46. <!-- static project variables as default styles.dita/xsl and names-->
  47. <xsl:param name="main_build_recurse_ant.dita" select="'main_build_recurse_ant.dita'"/>
  48. <xsl:param name="xml_id_parent" select="@xml_id"/>
  49. <xsl:param name="build_recurse_ant.xsl" required="yes"/>
  50. <xsl:param name="temp" required="yes"/>
  51. <xsl:param name="builds_to_ant.xsl" required="yes"/>
  52. <xsl:param name="cookie_curl_option" required="yes"/>
  53. <xsl:param name="loop_path_recurs" required="yes" /> <!-- loop path dla gromadzenia plikow dla RelatedFeatureLoop do przetworzen w rekurencji - domysmnie pusty, potem sie dobudowuje po wyzwoleniu anta w glab -->
  54. <xsl:param name="ignore_maxOccurs_0" select="false()"/>
  55. <xsl:param name="xpath_query"/>
  56. <xsl:param name="xpath_query.xsl" required="yes"/>
  57. <xsl:param name="empty.xml" required="yes"/>
  58. <xsl:param name="simpleSchema_dir" required="yes"/>
  59. <xsl:param name="default_db_xml_cache.public" required="yes"/>
  60. <!--<xsl:variable name="temp_current">
  61. <xsl:choose>
  62. <xsl:when test="$temp='temp'">
  63. <xsl:value-of select="concat($recurse_ant_basedir,'/',$temp)"/>
  64. </xsl:when>
  65. <xsl:otherwise>
  66. <xsl:value-of select="concat('temp/',$loop_path_recurs)"/>
  67. </xsl:otherwise>
  68. </xsl:choose>
  69. </xsl:variable>-->
  70. <!-- second step fist loop - with data -->
  71. <!--<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 -->
  72. <!-- opis dzialania template dla przetwarzania wezlow na podstawie schematu i budowania zagniezdzonego pliku xml z
  73. instancjami na podstawie tego samego schematu
  74. wyzwolenie inicjalizujace z build.xml buduje "wyzwolenie glowne" gdzie na output daje wynikowy build.
  75. system wyzwala dwa etapy
  76. wyzwolenie glowne - do okreslenia zaleznosci wezla i zbudowania zapytania o dane
  77. wyzwolenie after_first_ant_assing_vars - do podstawienia danych z wyzwolenia poprzedniego oraz przygotowania build "dla kolejnego X" do wyzwolenia glownego
  78. wyzwolenie glowne - szuka pierwszego RelatedFeature, ktore zawsze domyslnie jest na poczatku template, potem w nim grzebie - jak znajdzie - wchodzi w dol
  79. w ramach tego wyzwolenia przygotowuje task dla biezecego przygotowania ant_build - mode ant_target
  80. w ramach tego wyzwolenia juz musi przeanalizowac jakie sa dalsze zadania do wyzwolenia "dla kolejnego X' ant_build -
  81. 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
  82. wyzwolenie after_first_ant_assing_vars - to wyzwile
  83. to wyzwolenie podstawia dane do dita.vals.xml w celu zlozenia pliku wyjsciowego
  84. to wyzwolenie powinno juz zrobic ant_buildy "dla kolejnego X'
  85. to wyzwolenie korzysta z apply-templates wyzwolenia glownego, w celu przygotowania ant_build
  86. -->
  87. <xsl:template match="*">
  88. <xsl:param name="typeName" select="$typeName" />
  89. <xsl:param name="xpath" select="$xpath" />
  90. <xsl:param name="xpath_value" select="$xpath_value" />
  91. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  92. <xsl:param name="loop_xpath_save" select="$loop_xpath_save"/><!-- tutaj zapisal sie build z wezla z parent -->
  93. <xsl:param name="input_obj_with_xpath" /> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs" -->
  94. <xsl:param name="feature_pos" select="1"/> <!-- przekazany z template match="RelatedFeature" mode="after_first_ant_assing_vars_childs"-->
  95. <xsl:param name="loop_path_recurs" select="$loop_path_recurs"/> <!-- przekazany z RelatedFeatureLoop z mode="after_first_ant_assing_vars_childs" -->
  96. <xsl:choose>
  97. <xsl:when test="name()='RelatedFeature'">
  98. <xsl:variable name="RelatedFeatureCount" select="last()"/>
  99. <xsl:variable name="RelatedFeaturePos" select="position()"/>
  100. <xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
  101. <xsl:message>#58 bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>; $basedir=<xsl:value-of select="$basedir"/>; </xsl:message>
  102. <xsl:variable name="loop_xpath_real" select="$loop_xpath"/>
  103. <xsl:variable name="loop_xpath">
  104. <xsl:choose>
  105. <xsl:when test="$loop_xpath='root'">
  106. <xsl:value-of select="concat($loop_xpath,'_x2f_.',@xml_id,'.',$featureID_name)"/>
  107. </xsl:when>
  108. <xsl:otherwise><xsl:value-of select="$loop_xpath"/></xsl:otherwise>
  109. </xsl:choose>
  110. </xsl:variable>
  111. <xsl:variable name="typeName_dita" select="@typeName"/>
  112. <xsl:variable name="typeNameRealResource">
  113. <!-- override in case of different real resource by filtered resource -->
  114. <xsl:choose>
  115. <xsl:when test="@typeNameRealResource"><xsl:value-of select="@typeNameRealResource"/></xsl:when>
  116. <xsl:otherwise><xsl:value-of select="$typeName_dita"/></xsl:otherwise>
  117. </xsl:choose>
  118. </xsl:variable>
  119. <xsl:variable name="featureID_name_dita" select="substring-after($typeName_dita,':')"/>
  120. <xsl:variable name="xml_id" select="@xml_id"/>
  121. <!--<xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath,'_x2f_',$featureID_name)"/>-->
  122. <xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath)"/>
  123. <!--<xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.xml')"/>-->
  124. <xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.xml')"/>
  125. <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.dita.xml')"/>
  126. <!--<xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.','.dita.xml')"/>-->
  127. <!-- dane z oczekiwanego template .dita -->
  128. <xsl:variable name="xpath_dita">
  129. <xsl:choose>
  130. <xsl:when test=" string-length($xpath) &gt;0">
  131. <xsl:value-of select="$xpath"/>
  132. <xsl:message>#121 narzucam $xpath=(<xsl:value-of select="$xpath"/>) z wyzwolenia build.xml </xsl:message>
  133. </xsl:when>
  134. <xsl:otherwise><xsl:value-of select="@xpath"/></xsl:otherwise>
  135. </xsl:choose>
  136. </xsl:variable>
  137. <xsl:variable name="xpath_value_dita">
  138. <xsl:choose>
  139. <xsl:when test="@xpath_value">
  140. <!--<xsl:variable name="xpath_value_tokens" select="tokenize(@xpath_value,'/')"/>-->
  141. <!--<xsl:value-of select="'todo zapytanie xpath do przetworzenia'"/>-->
  142. <!--<xsl:copy-of select="$xpath_value_tokens"></xsl:copy-of>-->
  143. <!--<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>-->
  144. <xsl:message>#67.1 $input_obj_with_xpath: <xsl:copy-of select="$input_obj_with_xpath"/> </xsl:message>
  145. <!--<xsl:variable name="xpath_value_token">-->
  146. <xsl:call-template name="xpath_filter_apply">
  147. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  148. <xsl:with-param name="xpath" select="@xpath"/>
  149. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  150. </xsl:call-template>
  151. <!--</xsl:variable>-->
  152. <!--<xsl:message>#73 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message>-->
  153. <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
  154. <!--<xsl:value-of select="$xpath_value_token"/>-->
  155. </xsl:when>
  156. <xsl:when test="string-length($xpath_value) &gt;0">
  157. <xsl:message>#67.0 $xpath_value=(<xsl:value-of select="$xpath_value"/>); narzucone pewnie z wyzwolenia build.xml</xsl:message>
  158. <xsl:value-of select="$xpath_value"/>
  159. </xsl:when>
  160. <xsl:otherwise>
  161. <xsl:value-of select="$xpath_value"/><!-- parametr z template narzuca wartosc -->
  162. </xsl:otherwise>
  163. </xsl:choose>
  164. </xsl:variable>
  165. <xsl:message>#71 wstawiam projekt $feature_pos=<xsl:value-of select="$feature_pos"/>; $loop_xpath=<xsl:value-of select="$loop_xpath"/>; </xsl:message>
  166. <project basedir="{$recurse_ant_basedir}" name="get_related_feature{$loop_xpath_real}" default="get_related_feature_run_child_ant_if{$loop_xpath_real}">
  167. <!--
  168. get_related_feature_run_child_ant{$loop_xpath_real} - domyslny przed 2017-03-28-->
  169. <!-- get_related_feature_run_child_ant{$loop_xpath_real} -->
  170. <xsl:comment>RelatedFeatureCount:<xsl:value-of select="count(*)"/></xsl:comment>
  171. <echo> ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>; projekt <xsl:value-of select="$loop_xpath_real"/>; </echo>
  172. <!--<xsl:variable name="typeName" select='replace($typeName,"&quot;","")'/>--><!-- oczyszczenie z apostrofow -->
  173. <xsl:element name="property">
  174. <xsl:attribute name="name" select="'uuid'"/>
  175. <xsl:attribute name="value" select="$uuid"/>
  176. </xsl:element>
  177. <xsl:element name="property">
  178. <xsl:attribute name="name" select="'passwordBase64Basic'"/>
  179. <xsl:attribute name="value" select="$passwordBase64Basic"/>
  180. </xsl:element>
  181. <xsl:element name="property">
  182. <xsl:attribute name="name" select="'php_session_id'"/>
  183. <xsl:attribute name="value" select="$cookie_curl_option"/>
  184. </xsl:element>
  185. <xsl:element name="property">
  186. <xsl:attribute name="name" select="'url'"/>
  187. <xsl:attribute name="value" select="$url"/>
  188. </xsl:element>
  189. <xsl:element name="property">
  190. <xsl:attribute name="name" select="'webRootUrl'"/>
  191. <xsl:attribute name="value" select="$webRootUrl"/>
  192. </xsl:element>
  193. <xsl:element name="property">
  194. <xsl:attribute name="name" select="'build_recurse_ant.xsl'"/>
  195. <xsl:attribute name="value" select="$build_recurse_ant.xsl"/>
  196. </xsl:element>
  197. <xsl:element name="property">
  198. <xsl:attribute name="name" select="'temp'"/>
  199. <xsl:attribute name="value" select="$temp"/>
  200. </xsl:element>
  201. <xsl:element name="property">
  202. <xsl:attribute name="name" select="'builds_to_ant.xsl'"/>
  203. <xsl:attribute name="value" select="$builds_to_ant.xsl"/>
  204. </xsl:element>
  205. <xsl:element name="property">
  206. <xsl:attribute name="name" select="'loop_path_recurs'"/>
  207. <xsl:attribute name="value" select="$loop_path_recurs"/>
  208. </xsl:element>
  209. <xsl:element name="property">
  210. <xsl:attribute name="name" select="'xpath_query'"/>
  211. <xsl:attribute name="value" select="$xpath_query"/>
  212. </xsl:element>
  213. <xsl:element name="property">
  214. <xsl:attribute name="name" select="'ignore_maxOccurs_0'"/>
  215. <xsl:attribute name="value" select="$ignore_maxOccurs_0"/>
  216. </xsl:element>
  217. <xsl:element name="property">
  218. <xsl:attribute name="name" select="'default_db:recurse_ant_basedir'"/>
  219. <xsl:attribute name="value" select="'.'"/>
  220. </xsl:element>
  221. <property name="simpleSchema_dir" value="{$simpleSchema_dir}"/>
  222. <property name="default_db_xml_cache.public" value="{$default_db_xml_cache.public}"/>
  223. <property name="temp" value="{$temp}"/>
  224. <xsl:comment>
  225. #224 Important variables:
  226. typeName=<xsl:value-of select="$typeName"/>;
  227. xpath=<xsl:value-of select="$xpath"/>;
  228. xpath_value=<xsl:value-of select="$xpath_value"/>;
  229. $passwordBase64Basic=<xsl:value-of select="$passwordBase64Basic"/>
  230. #221
  231. $typeName_dita= <xsl:value-of select="$typeName_dita"/>
  232. $featureID_name_dita= <xsl:value-of select="$featureID_name_dita"/>
  233. $wfs_output= <xsl:value-of select="$wfs_output"/>
  234. $wfs_output.xml= <xsl:value-of select="$wfs_output.xml"/>
  235. $wfs_output.dita= <xsl:value-of select="$wfs_output.dita"/>
  236. $xpath_dita= <xsl:value-of select="$xpath_dita"/>
  237. $xpath_value_dita= <xsl:value-of select="$xpath_value_dita"/>
  238. $ignore_maxOccurs= <xsl:value-of select="$ignore_maxOccurs_0"/> ; @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>
  239. $xpath_query=<xsl:value-of select="$xpath_query"/>;
  240. </xsl:comment>
  241. <!-- BEGIN test if get xpath_query -->
  242. <!--<target name="get_related_feature_run_child_ant__test_xpath_query_{$loop_xpath_real}">
  243. <echo>testuje czy sciagac node poprzez $xpath_query.xsl to <xsl:value-of select="concat('${builds_to_ant_file_test_xpath_query.xml',$loop_xpath_real,@xml_id,'}')"/></echo>
  244. <xsl:element name="tempfile">
  245. <xsl:attribute name="property" select="concat('builds_to_ant_test_featureID_name_dita',$loop_xpath_real,@xml_id)"/>
  246. <xsl:attribute name="deleteonexit" select="'no'"/>
  247. <xsl:attribute name="destdir" select="$temp"/>
  248. <xsl:attribute name="suffix" select="'.xml'"/>
  249. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-loop_test_featureID_name_dita',@xml_id,'-')"/>
  250. </xsl:element>
  251. <xsl:element name="echoxml">
  252. <xsl:attribute name="file" select="concat('${builds_to_ant_test_featureID_name_dita',$loop_xpath_real,@xml_id,'}')"/>
  253. <xsl:element name="{$featureID_name_dita}">empty</xsl:element>
  254. </xsl:element>
  255. <xsl:element name="tempfile">
  256. <xsl:attribute name="property" select="concat('builds_to_ant_test_featureID_name_dita_out.xml',$loop_xpath_real,@xml_id)"/>
  257. <xsl:attribute name="deleteonexit" select="'no'"/>
  258. <xsl:attribute name="destdir" select="$temp"/>
  259. <xsl:attribute name="suffix" select="'.xml'"/>
  260. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-loop_test_featureID_name_dita_out',@xml_id,'-')"/>
  261. </xsl:element>
  262. <xsl:element name="xslt">
  263. <xsl:attribute name="basedir" select="'./'"/>
  264. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  265. <xsl:attribute name="in" select="concat('${builds_to_ant_test_featureID_name_dita',$loop_xpath_real,@xml_id,'}')"/>
  266. <xsl:attribute name="destdir" select="'./'"/>
  267. <xsl:attribute name="out" select="concat('${builds_to_ant_test_featureID_name_dita_out.xml',$loop_xpath_real,@xml_id,'}')"/>
  268. <factory name="net.sf.saxon.TransformerFactoryImpl">
  269. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  270. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  271. </factory>
  272. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  273. <!-\-<param name="featureID_name_dita" expression="{$featureID_name_dita}"/>-\->
  274. </xsl:element>
  275. <xsl:element name="loadfile">
  276. <xsl:attribute name="property" select="concat('builds_to_ant_test_275.xml',$loop_xpath_real,@xml_id)"/>
  277. <xsl:attribute name="srcfile" select="concat('${builds_to_ant_test_featureID_name_dita_out.xml',$loop_xpath_real,@xml_id,'}')"/>
  278. </xsl:element>
  279. <xsl:element name="condition">
  280. <xsl:attribute name="taskname" select="concat('get_related_feature_run_child_ant__test_xpath_query_if_',$loop_xpath_real)"/>
  281. <xsl:attribute name="property" select="concat('builds_to_ant_test_280.xml',$loop_xpath_real,@xml_id)"/>
  282. <xsl:element name="contains">
  283. <xsl:attribute name="string" select="concat('${builds_to_ant_test_275.xml',$loop_xpath_real,@xml_id,'}')"/>
  284. <xsl:attribute name="substring" select="'OK'"/>
  285. </xsl:element>
  286. </xsl:element>
  287. <echo>#287 contains ERROR/OK: ${builds_to_ant_test_275.xml<xsl:value-of select="concat($loop_xpath_real,@xml_id)"/>} </echo>
  288. </target>
  289. <target depends="get_related_feature_run_child_ant__test_xpath_query_{$loop_xpath_real}">
  290. <xsl:attribute name="if" select="concat('${builds_to_ant_test_280.xml',$loop_xpath_real,@xml_id,'}')"/>
  291. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant__test_xpath_query_if_',$loop_xpath_real)"/>
  292. <antcall target="get_related_feature_run_child_ant{$loop_xpath_real}"/>
  293. </target>-->
  294. <!-- EOF test if get xpath_query -->
  295. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  296. <echo> #302 waliduje xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; </echo>
  297. <target name="get_related_feature_run_child_ant_check{$loop_xpath_real}">
  298. <xsl:element name="tempfile">
  299. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml')"/>
  300. <xsl:attribute name="deleteonexit" select="'no'"/>
  301. <xsl:attribute name="destdir" select="$temp"/>
  302. <xsl:attribute name="suffix" select="'.xml'"/>
  303. <xsl:attribute name="prefix" select="concat('__test_featureID_name_dita_',$featureID_name_dita)"/>
  304. </xsl:element>
  305. <xsl:element name="echoxml">
  306. <xsl:attribute name="file" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml}')"/>
  307. <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/></xsl:element>
  308. </xsl:element>
  309. <xsl:element name="tempfile">
  310. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml')"/>
  311. <xsl:attribute name="deleteonexit" select="'no'"/>
  312. <xsl:attribute name="destdir" select="$temp"/>
  313. <xsl:attribute name="suffix" select="'.xml'"/>
  314. <xsl:attribute name="prefix" select="concat('__test_featureID_name_dita_out_',$featureID_name_dita)"/>
  315. </xsl:element>
  316. <xsl:element name="xslt">
  317. <xsl:attribute name="basedir" select="'./'"/>
  318. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  319. <xsl:attribute name="in" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita.xml}')"/>
  320. <xsl:attribute name="destdir" select="'./'"/>
  321. <xsl:attribute name="out" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml}')"/>
  322. <factory name="net.sf.saxon.TransformerFactoryImpl">
  323. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  324. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  325. </factory>
  326. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  327. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  328. </xsl:element>
  329. <xsl:element name="loadfile">
  330. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile.xml')"/>
  331. <xsl:attribute name="srcfile" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_out.xml}')"/>
  332. </xsl:element>
  333. <condition taskname="get_related_feature_run_child_ant_if{$loop_xpath_real}">
  334. <xsl:attribute name="property" select="concat($temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile_check.xml')"/>
  335. <xsl:element name="contains">
  336. <xsl:attribute name="string" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile.xml}')"/>
  337. <xsl:attribute name="substring" select="'OK'"/>
  338. </xsl:element>
  339. </condition>
  340. </target>
  341. <target name="get_related_feature_run_child_ant_if{$loop_xpath_real}" depends="get_related_feature_run_child_ant_check{$loop_xpath_real}">
  342. <xsl:attribute name="if" select="concat('${',$temp,'-',$wfs_output.xml,'__test_featureID_name_dita_loadfile_check.xml}')"/>
  343. <antcall target="get_related_feature_run_child_ant{$loop_xpath_real}"/>
  344. </target>
  345. <!-- EOF dajemy wpis o walidacji danego feature pod katem xpath_query -->
  346. <xsl:apply-templates mode="ant_target" select=".">
  347. <xsl:with-param name="typeName_dita" select="$typeName_dita"/>
  348. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  349. <xsl:with-param name="wfs_output" select="$wfs_output"/>
  350. <xsl:with-param name="wfs_output.xml" select="$wfs_output.xml"/>
  351. <xsl:with-param name="wfs_output.dita" select="$wfs_output.dita"/>
  352. <xsl:with-param name="xpath" select="$xpath"/>
  353. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  354. <xsl:with-param name="featureID_name" select="$featureID_name"/>
  355. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  356. <xsl:with-param name="RelatedFeatureCount" select="$RelatedFeatureCount"/>
  357. <xsl:with-param name="RelatedFeaturePos" select="$RelatedFeaturePos"/>
  358. <xsl:with-param name="typeName" select="$typeName"/>
  359. <xsl:with-param name="xpath_value" select="$xpath_value"/>
  360. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  361. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  362. <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath_save"/>-->
  363. <xsl:with-param name="xml_id" select="$xml_id"/>
  364. <!--<xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>-->
  365. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  366. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  367. <xsl:with-param name="typeNameRealResource" select="$typeNameRealResource"/>
  368. </xsl:apply-templates>
  369. <!-- na koniec przetwarzania kazdego z wezlow, podmieniamy xsl biezacy wezel -->
  370. <xsl:comment>template match="RelatedFeature" mode="after_first_ant_assing_vars_childs"
  371. robi result-document href="build_{$loop_xpath}.{$uuid}.xml
  372. wiec powinnismy uruchomic ant ten plik w ciemno znajac jego nizsze wezly</xsl:comment>
  373. <xsl:variable name="featureID_name_child" select="substring-after($typeName,':')"/>
  374. <xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
  375. <xsl:message>#142 ustalamy $loop_xpath_child=<xsl:value-of select="$loop_xpath_child"/></xsl:message>
  376. <xsl:element name="target">
  377. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath_real)"/>
  378. <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos,$loop_xpath_real)"/>
  379. <!--<xsl:choose>
  380. <xsl:when test=".//(RelatedFeature|RelatedFeatureRoot)">
  381. <xsl:for-each select=".//RelatedFeature[ not(child::node()/name()='RelatedFeature')]">
  382. <xsl:variable name="loop_xpath_child_ant" select="concat($loop_xpath_save,'_x2f_.',@xml_id,'.',$featureID_name)"/>
  383. <xsl:message>#148 ustalamy $loop_xpath_child_ant=<xsl:value-of select="$loop_xpath_child_ant"/></xsl:message>
  384. <!-\- <xsl:element name="target">
  385. <xsl:attribute name="name" select="$loop_xpath_child_ant"/><!-\\-'get_related_feature_run_child_ant'-\\->
  386. <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>-\->
  387. <!-\-<ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.xml" dir="."/>-\->
  388. <ant antfile="temp/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>
  389. <!-\-</xsl:element>-\->
  390. <xsl:if test=" position()=last()">
  391. <xsl:comment>Tu task z related</xsl:comment>
  392. </xsl:if>
  393. </xsl:for-each>
  394. </xsl:when>
  395. <xsl:otherwise>
  396. <xsl:comment>#135 nie ma wiecej //RelatedFeature</xsl:comment>
  397. <!-\-<xsl:element name="target">
  398. <xsl:attribute name="name" select="'get_related_feature_run_child_ant'"/>
  399. <xsl:attribute name="depends" select="concat('get_related_feature.',$RelatedFeaturePos)"/>
  400. </xsl:element>-\->
  401. </xsl:otherwise>
  402. </xsl:choose>-->
  403. <!-- wstawienie subanta dla biezacych dzieci only -->
  404. <xsl:apply-templates mode="place_subant">
  405. <xsl:with-param name="uuid" select="$uuid"/>
  406. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  407. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  408. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  409. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  410. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  411. <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
  412. </xsl:apply-templates>
  413. </xsl:element>
  414. <!-- na koniec przetwarzania danego zaglebienia uruchamiamy calosc ponownie do kolejnego zaglebienia -->
  415. <!-- task do polaczenia zaglebien -->
  416. <!-- jak nie ma zaglebien to generujemy pdf i dajemy uzytkownikowi linka -->
  417. </project>
  418. </xsl:when>
  419. <xsl:when test="name()='RelatedFeatureLoop'">
  420. <xsl:message>#255 RelatedFeatureLoop - try to execute child ant in loop_path=xml_id(<xsl:value-of select="@xml_id"/>)</xsl:message>
  421. <xsl:variable name="RelatedFeatureCount" select="last()"/>
  422. <xsl:variable name="RelatedFeaturePos" select="position()"/>
  423. <xsl:variable name="featureID_name" select="substring-after($typeName,':')"/>
  424. <xsl:variable name="loop_xpath_real" select="$loop_xpath"/>
  425. <xsl:variable name="loop_xpath">
  426. <xsl:choose>
  427. <xsl:when test="$loop_xpath='root'">
  428. <xsl:value-of select="concat($loop_xpath,'_x2f_.',@xml_id,'.',$featureID_name)"/>
  429. </xsl:when>
  430. <xsl:otherwise><xsl:value-of select="$loop_xpath"/></xsl:otherwise>
  431. </xsl:choose>
  432. </xsl:variable>
  433. <xsl:variable name="typeName_dita" select="@typeName"/>
  434. <xsl:variable name="typeNameRealResource">
  435. <!-- override in case of different real resource by filtered resource -->
  436. <xsl:choose>
  437. <xsl:when test="@typeNameRealResource"><xsl:value-of select="@typeNameRealResource"/></xsl:when>
  438. <xsl:otherwise><xsl:value-of select="@typeName"/></xsl:otherwise>
  439. </xsl:choose>
  440. </xsl:variable>
  441. <xsl:variable name="featureID_name_dita" select="substring-after($typeName_dita,':')"/>
  442. <xsl:variable name="xml_id" select="@xml_id"/>
  443. <xsl:variable name="wfs_output" select="concat($uuid,'.',$loop_xpath)"/>
  444. <xsl:variable name="wfs_output.xml" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.xml')"/>
  445. <xsl:variable name="wfs_output.dita" select="concat($wfs_output,'.',position(),'.',$feature_pos,'.dita.xml')"/>
  446. <xsl:variable name="xpath_dita" select="@xpath"/>
  447. <xsl:variable name="xpath_value_dita">
  448. <xsl:choose>
  449. <xsl:when test="@xpath_value">
  450. <xsl:message>#265.1 $input_obj_with_xpath: <xsl:copy-of select="$input_obj_with_xpath"/> </xsl:message>
  451. <xsl:call-template name="xpath_filter_apply">
  452. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  453. <xsl:with-param name="xpath" select="@xpath"/>
  454. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  455. </xsl:call-template>
  456. </xsl:when>
  457. <xsl:otherwise>
  458. <xsl:value-of select="$xpath_value"/><!-- parametr z template narzuca wartosc -->
  459. </xsl:otherwise>
  460. </xsl:choose>
  461. </xsl:variable>
  462. <xsl:comment>
  463. RelatedFeatureLoop: #344
  464. $typeName_dita= <xsl:value-of select="$typeName_dita"/>
  465. $featureID_name_dita= <xsl:value-of select="$featureID_name_dita"/>
  466. $wfs_output= <xsl:value-of select="$wfs_output"/>
  467. $wfs_output.xml= <xsl:value-of select="$wfs_output.xml"/>
  468. $wfs_output.dita= <xsl:value-of select="$wfs_output.dita"/>
  469. $xpath_dita= <xsl:value-of select="$xpath_dita"/>
  470. $xpath_value_dita= <xsl:value-of select="$xpath_value_dita"/>
  471. $ignore_maxOccurs= <xsl:value-of select="$ignore_maxOccurs_0"/> ; @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>
  472. $xpath_query=<xsl:value-of select="$xpath_query"/>;
  473. </xsl:comment>
  474. <project basedir="{$recurse_ant_basedir.temp}{$loop_path_recurs}" name="get_related_feature{$loop_xpath_real}_{$loop_path_recurs}" default="get_related_feature_run_child_ant_if_query_{$loop_xpath_real}_{$loop_path_recurs}"> <!-- get_related_feature_run_child_ant{$loop_xpath_real}_{$loop_path_recurs -->
  475. <!-- default przed 2017-03-28 concat('get_related_feature_run_child_ant_if_query_',$loop_xpath_real,'_',$loop_path_recurs)
  476. get_related_feature_run_child_ant{$loop_xpath_real}_{$loop_path_recurs} -->
  477. <xsl:comment>RelatedFeatureCount:<xsl:value-of select="count(*)"/></xsl:comment>
  478. <echo> ANT Uruchamiam $feature_pos=<xsl:value-of select="$feature_pos"/>; projekt <xsl:value-of select="$loop_xpath_real"/>; </echo>
  479. <!--<xsl:variable name="typeName" select='replace($typeName,"&quot;","")'/>--><!-- oczyszczenie z apostrofow -->
  480. <xsl:element name="property">
  481. <xsl:attribute name="name" select="'uuid'"/>
  482. <xsl:attribute name="value" select="$uuid"/>
  483. </xsl:element>
  484. <xsl:element name="property">
  485. <xsl:attribute name="name" select="'passwordBase64Basic'"/>
  486. <xsl:attribute name="value" select="$passwordBase64Basic"/>
  487. </xsl:element>
  488. <xsl:element name="property">
  489. <xsl:attribute name="name" select="'php_session_id'"/>
  490. <xsl:attribute name="value" select="$cookie_curl_option"/>
  491. </xsl:element>
  492. <xsl:element name="property">
  493. <xsl:attribute name="name" select="'php_session_id_tested'"/>
  494. <xsl:attribute name="value" select="$cookie_curl_option"/>
  495. </xsl:element>
  496. <xsl:element name="property">
  497. <xsl:attribute name="name" select="'url'"/>
  498. <xsl:attribute name="value" select="$url"/>
  499. </xsl:element>
  500. <xsl:element name="property">
  501. <xsl:attribute name="name" select="'webRootUrl'"/>
  502. <xsl:attribute name="value" select="$webRootUrl"/>
  503. </xsl:element>
  504. <xsl:element name="property"> <!--- powinien miec domyslnie sciezke narzucona-->
  505. <xsl:attribute name="name" select="'build_recurse_ant.xsl'"/>
  506. <xsl:attribute name="value" select="$build_recurse_ant.xsl"/>
  507. </xsl:element>
  508. <!--<xsl:element name="property"> <!-\-\- powinien miec domyslnie narzucona sciezke-\->
  509. <xsl:attribute name="name" select="'temp'"/>
  510. <xsl:attribute name="value" select="$temp"/>
  511. </xsl:element>-->
  512. <xsl:element name="property"><!-- - powinien miec sciezke domyslnie narzucona-->
  513. <xsl:attribute name="name" select="'builds_to_ant.xsl'"/>
  514. <xsl:attribute name="value" select="$builds_to_ant.xsl"/>
  515. </xsl:element>
  516. <property name="typeName" value="{$typeName}"/>
  517. <property name="xpath" value="{$xpath_dita}"/>
  518. <property name="xpath_value" value="{$xpath_value_dita}"/>
  519. <!-- DtypeName=p5_default_db:CRM_PROCES -Dxpath=ID -Dxpath_value=5247 -->
  520. <property name="loop_path_recurs" value="{$loop_path_recurs}"/>
  521. <xsl:element name="property">
  522. <xsl:attribute name="name" select="'xpath_query'"/>
  523. <xsl:attribute name="value" select="$xpath_query"/>
  524. </xsl:element>
  525. <xsl:element name="property">
  526. <xsl:attribute name="name" select="'ignore_maxOccurs_0'"/>
  527. <xsl:attribute name="value" select="$ignore_maxOccurs_0"/>
  528. </xsl:element>
  529. <xsl:element name="property">
  530. <xsl:attribute name="name" select="'default_db:recurse_ant_basedir'"/>
  531. <xsl:attribute name="value" select="$recurse_ant_basedir"/>
  532. </xsl:element>
  533. <xsl:element name="property">
  534. <xsl:attribute name="name" select="'default_db:recurse_ant'"/>
  535. <xsl:attribute name="value" select="$recurse_ant"/>
  536. </xsl:element>
  537. <xsl:element name="property">
  538. <xsl:attribute name="name" select="'default_db:recurse_ant_basedir.temp'"/>
  539. <xsl:attribute name="value" select="$recurse_ant_basedir.temp"/>
  540. </xsl:element>
  541. <property name="simpleSchema_dir" value="{$simpleSchema_dir}"/>
  542. <property name="default_db_xml_cache.public" value="{$default_db_xml_cache.public}"/>
  543. <xsl:element name="property">
  544. <xsl:attribute name="name" select="'temp'"/>
  545. <xsl:attribute name="value" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
  546. </xsl:element>
  547. <xsl:comment>
  548. #555 Important variables:
  549. typeName=<xsl:value-of select="$typeName"/>;
  550. xpath=<xsl:value-of select="$xpath"/>;
  551. xpath_value=<xsl:value-of select="$xpath_value"/>;
  552. $passwordBase64Basic=<xsl:value-of select="$passwordBase64Basic"/>
  553. </xsl:comment>
  554. <!--<xsl:apply-templates mode="ant_target" select=".">
  555. <xsl:with-param name="typeName_dita" select="$typeName_dita"/>
  556. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  557. <xsl:with-param name="wfs_output" select="$wfs_output"/>
  558. <xsl:with-param name="wfs_output.xml" select="$wfs_output.xml"/>
  559. <xsl:with-param name="wfs_output.dita" select="$wfs_output.dita"/>
  560. <xsl:with-param name="xpath" select="$xpath"/>
  561. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  562. <xsl:with-param name="featureID_name" select="$featureID_name"/>
  563. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  564. <xsl:with-param name="RelatedFeatureCount" select="$RelatedFeatureCount"/>
  565. <xsl:with-param name="RelatedFeaturePos" select="$RelatedFeaturePos"/>
  566. <xsl:with-param name="typeName" select="$typeName"/>
  567. <xsl:with-param name="xpath_value" select="$xpath_value"/>
  568. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  569. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  570. <!-\-<xsl:with-param name="loop_xpath_save" select="$loop_xpath_save"/>-\->
  571. <xsl:with-param name="xml_id" select="$xml_id"/>
  572. <!-\-<xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>-\->
  573. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  574. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  575. </xsl:apply-templates>-->
  576. <!-- na koniec przetwarzania kazdego z wezlow, podmieniamy xsl biezacy wezel -->
  577. <xsl:comment>template match="RelatedFeature" mode="after_first_ant_assing_vars_childs"
  578. robi result-document href="build_{$loop_xpath}.{$uuid}.xml
  579. wiec powinnismy uruchomic ant ten plik w ciemno znajac jego nizsze wezly</xsl:comment>
  580. <xsl:variable name="featureID_name_child" select="substring-after($typeName,':')"/>
  581. <xsl:variable name="loop_xpath_child" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
  582. <xsl:message>#142 ustalamy $loop_xpath_child=<xsl:value-of select="$loop_xpath_child"/>; maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; </xsl:message>
  583. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  584. <echo> #592 waliduje xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; </echo>
  585. <target>
  586. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant_if_query_test',$loop_xpath_real,'_',$loop_path_recurs)"/>
  587. <xsl:element name="tempfile">
  588. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test',$loop_xpath_real,'_',$loop_path_recurs,'_temp')"/>
  589. <xsl:attribute name="deleteonexit" select="'no'"/>
  590. <xsl:attribute name="destdir" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
  591. <xsl:attribute name="suffix" select="'.xml'"/>
  592. <xsl:attribute name="prefix" select="concat('__test_featureID_name_dita_',$featureID_name_dita)"/>
  593. </xsl:element>
  594. <xsl:element name="echoxml">
  595. <xsl:attribute name="file" select="concat('${get_related_feature_run_child_ant_xpath_test',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  596. <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/></xsl:element>
  597. </xsl:element>
  598. <xsl:element name="tempfile">
  599. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test_out',$loop_xpath_real,'_',$loop_path_recurs,'_temp')"/>
  600. <xsl:attribute name="deleteonexit" select="'no'"/>
  601. <xsl:attribute name="destdir" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
  602. <xsl:attribute name="suffix" select="'.xml'"/>
  603. <xsl:attribute name="prefix" select="concat('__test_featureID_name_dita_out_',$featureID_name_dita)"/>
  604. </xsl:element>
  605. <xsl:element name="xslt">
  606. <xsl:attribute name="basedir" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
  607. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  608. <xsl:attribute name="in" select="concat('${get_related_feature_run_child_ant_xpath_test',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  609. <xsl:attribute name="destdir" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
  610. <xsl:attribute name="out" select="concat('${get_related_feature_run_child_ant_xpath_test_out',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  611. <factory name="net.sf.saxon.TransformerFactoryImpl">
  612. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  613. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  614. </factory>
  615. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  616. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  617. </xsl:element>
  618. <xsl:element name="loadfile">
  619. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test_loadfile',$loop_xpath_real,'_',$loop_path_recurs,'_temp')"/>
  620. <xsl:attribute name="srcfile" select="concat('${get_related_feature_run_child_ant_xpath_test_out',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  621. </xsl:element>
  622. <echo>#633 test xpath_query.xsl ${<xsl:value-of select="concat('get_related_feature_run_child_ant_xpath_test_loadfile',$loop_xpath_real,'_',$loop_path_recurs,'_temp')"/>} ;</echo>
  623. <condition >
  624. <xsl:attribute name="taskname" select="concat('get_related_feature_run_child_ant_if_query_',$loop_xpath_real,'_',$loop_path_recurs)"/>
  625. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant_xpath_test_loadfile_check',$loop_xpath_real,'_',$loop_path_recurs,'_temp')"/>
  626. <xsl:element name="contains">
  627. <xsl:attribute name="string" select="concat('${get_related_feature_run_child_ant_xpath_test_loadfile',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  628. <xsl:attribute name="substring" select="'OK'"/>
  629. </xsl:element>
  630. </condition>
  631. </target>
  632. <target>
  633. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant_if_query_',$loop_xpath_real,'_',$loop_path_recurs)"/>
  634. <xsl:attribute name="depends" select="concat('get_related_feature_run_child_ant_if_query_test',$loop_xpath_real,'_',$loop_path_recurs)"/>
  635. <xsl:attribute name="if" select="concat('${get_related_feature_run_child_ant_xpath_test_loadfile_check',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  636. <antcall target="get_related_feature_run_child_ant{$loop_xpath_real}_{$loop_path_recurs}"/>
  637. </target>
  638. <!-- EOF dajemy wpis o walidacji danego feature pod katem xpath_query -->
  639. <!-- warunek dla ograniczenia zapetlenia TODO do optymalizacji aby nie potrzebnie nie robilo zapytania czy jest wezel zaglebiony -->
  640. <xsl:element name="target">
  641. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_check')"/>
  642. <!--<tempfile property="test_child_curl_ouptut.xml"/>--> <!-- todo deleteonexit=yes -->
  643. <xsl:element name="tempfile">
  644. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_temp')" />
  645. <xsl:attribute name="destdir" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
  646. <xsl:attribute name="prefix" select="'test_if_exec_child_ant-'"/>
  647. <xsl:attribute name="suffix" select="'.xml'"/>
  648. </xsl:element>
  649. <xsl:variable name="OGC_Filter">
  650. <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
  651. <xsl:with-param name="simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
  652. <xsl:with-param name="RelatedFilter" select="RelatedFilter"/>
  653. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  654. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  655. </xsl:call-template>
  656. </xsl:variable>
  657. <xsl:variable name="url">
  658. <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"/>
  659. </xsl:variable>
  660. <xsl:element name="exec">
  661. <xsl:attribute name="executable" select="'curl'"/>
  662. <xsl:attribute name="output" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')"/>
  663. <xsl:element name="arg">
  664. <xsl:attribute name="line"> <xsl:value-of select="$cookie_curl_option"/> "<xsl:value-of select="$url"/>"</xsl:attribute>
  665. </xsl:element>
  666. </xsl:element>
  667. <xsl:element name="loadfile">
  668. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_msg')"/>
  669. <xsl:attribute name="srcFile" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_temp}')" />
  670. </xsl:element>
  671. <echo> $msg ${<xsl:value-of select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_msg')"/>} </echo>
  672. <xsl:element name="condition">
  673. <xsl:attribute name="property" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_test')"/>
  674. <xsl:attribute name="taskname" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs)"/>
  675. <xsl:element name="contains">
  676. <xsl:attribute name="string" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_msg}')"/>
  677. <xsl:attribute name="substring" select="'featureMember'"/>
  678. </xsl:element>
  679. </xsl:element>
  680. </xsl:element>
  681. <!--<target name="check_if_child">
  682. <exec executable="curl"
  683. 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"
  684. errorproperty="wfs_error"
  685. resultproperty="wfs_result">
  686. <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;"/>
  687. </exec>
  688. <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" />
  689. <echo> MSG to ${msg} </echo>
  690. <condition property="test" taskname="get_related_feature_run_child_antroot_x2f_.d3e1.CRM_PROCES_x2f_.d3e16.CRM_PROCES_/d3e16" >
  691. <contains string="${msg}" substring="featureMember"/>
  692. </condition>
  693. </target>-->
  694. <xsl:element name="target">
  695. <xsl:attribute name="name" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs)"/>
  696. <xsl:attribute name="depends" select="concat('get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_check')"/>
  697. <xsl:attribute name="if" select="concat('${get_related_feature_run_child_ant',$loop_xpath_real,'_',$loop_path_recurs,'_test}')"/>
  698. <ant antfile="{$recurse_ant_basedir}/build_recurse_ant.xml" target="xml_recursed_from_tr_map"/>
  699. </xsl:element>
  700. <!-- na koniec przetwarzania danego zaglebienia uruchamiamy calosc ponownie do kolejnego zaglebienia -->
  701. <!-- task do polaczenia zaglebien -->
  702. <!-- jak nie ma zaglebien to generujemy pdf i dajemy uzytkownikowi linka -->
  703. </project>
  704. </xsl:when>
  705. <xsl:otherwise>
  706. <xsl:comment>#723 child nodes</xsl:comment>
  707. <xsl:apply-templates mode="child_nodes"/>
  708. </xsl:otherwise>
  709. </xsl:choose>
  710. </xsl:template>
  711. <!-- trzeba przetwarzac child_nodes do pierwszego napotkania RelatedFeature -->
  712. <xsl:template mode="child_nodes" match="*">
  713. <xsl:copy-of select="."/>
  714. <xsl:comment>#732 eof copy . (mode=child_nodes match=*)</xsl:comment>
  715. </xsl:template>
  716. <!--<xsl:template mode="child_nodes" match="simpleTypeMakeOgcFilter">
  717. <xsl:message>#266 bypassing temporary simpleTypeMakeOgcFilter of problem with output </xsl:message>
  718. </xsl:template>-->
  719. <xsl:template mode="place_subant" match="RelatedFeature">
  720. <xsl:param name="uuid" required="yes"/>
  721. <xsl:param name="loop_xpath" required="yes"/>
  722. <xsl:param name="loop_xpath_real" required="yes"/>
  723. <xsl:param name="featureID_name_dita" required="yes"/>
  724. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  725. <echo>#684 dajemy wpis o walidacji danego feature pod katem xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/> </echo>
  726. <xsl:element name="tempfile">
  727. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita.xml',$loop_xpath_real,@xml_id)"/>
  728. <xsl:attribute name="deleteonexit" select="'no'"/>
  729. <xsl:attribute name="destdir" select="$temp"/>
  730. <xsl:attribute name="suffix" select="'.xml'"/>
  731. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-loop_test_featureID_name_dita',@xml_id,'-')"/>
  732. </xsl:element>
  733. <xsl:element name="echoxml">
  734. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_xpath_real,@xml_id,'}')"/>
  735. <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/></xsl:element>
  736. </xsl:element>
  737. <xsl:element name="tempfile">
  738. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_xpath_real,@xml_id)"/>
  739. <xsl:attribute name="deleteonexit" select="'no'"/>
  740. <xsl:attribute name="destdir" select="$temp"/>
  741. <xsl:attribute name="suffix" select="'.xml'"/>
  742. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-loop_test_featureID_name_dita_out',@xml_id,'-')"/>
  743. </xsl:element>
  744. <xsl:element name="xslt">
  745. <xsl:attribute name="basedir" select="$temp"/>
  746. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  747. <xsl:attribute name="in" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_xpath_real,@xml_id,'}')"/>
  748. <xsl:attribute name="destdir" select="$temp"/>
  749. <xsl:attribute name="out" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_xpath_real,@xml_id,'}')"/>
  750. <factory name="net.sf.saxon.TransformerFactoryImpl">
  751. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  752. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  753. </factory>
  754. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  755. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  756. </xsl:element>
  757. <!-- wygenerujemy liste ant -->
  758. <echo> #686 @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; ant szukam fileset id=builds_to_ant w <xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.*.xml')"/> </echo>
  759. <fileset id="builds_to_ant{$loop_xpath_real}{@xml_id}" dir="{$temp}" includes="{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.*.xml" />
  760. <property name="builds_to_ant{$loop_xpath_real}{@xml_id}" refid="builds_to_ant{$loop_xpath_real}{@xml_id}"/>
  761. <!--<tempfile property="builds_to_ant.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.builds_to_ant-"/>-->
  762. <xsl:element name="tempfile">
  763. <xsl:attribute name="property" select="concat('builds_to_ant.xml',$loop_xpath_real,@xml_id)"/>
  764. <xsl:attribute name="deleteonexit" select="'no'"/>
  765. <xsl:attribute name="destdir" select="$temp"/>
  766. <xsl:attribute name="suffix" select="'.xml'"/>
  767. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-',@xml_id,'-')"/>
  768. </xsl:element>
  769. <!--<tempfile property="builds_to_ant_file.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.build_to_ant_file-"/>-->
  770. <xsl:element name="tempfile">
  771. <xsl:attribute name="property" select="concat('builds_to_ant_file.xml',$loop_xpath_real,@xml_id)"/>
  772. <xsl:attribute name="deleteonexit" select="'no'"/>
  773. <xsl:attribute name="destdir" select="$temp"/>
  774. <xsl:attribute name="suffix" select="'.xml'"/>
  775. <xsl:attribute name="prefix" select="concat('${uuid}.build_to_ant_file-',@xml_id,'-')"/>
  776. </xsl:element>
  777. <echo>#235 ant do: builds_to_ant.xml=${builds_to_ant_file.xml} mode="place_subant" match="RelatedFeature" </echo>
  778. <!--<echoxml file="'${builds_to_ant.xml}'"><builds_to_ant>${builds_to_ant}</builds_to_ant></echoxml>-->
  779. <xsl:element name="echoxml">
  780. <xsl:attribute name="file" select="concat('${builds_to_ant.xml',$loop_xpath_real,@xml_id,'}')"/>
  781. <builds_to_ant>${builds_to_ant<xsl:value-of select="concat($loop_xpath_real,@xml_id)"/>}</builds_to_ant>
  782. </xsl:element>
  783. <xsl:element name="xslt">
  784. <xsl:attribute name="basedir" select="$temp"/>
  785. <xsl:attribute name="style" select="$builds_to_ant.xsl"/>
  786. <xsl:attribute name="in" select="concat('${builds_to_ant.xml',$loop_xpath_real,@xml_id,'}')"/>
  787. <xsl:attribute name="destdir" select="$temp"/>
  788. <xsl:attribute name="out" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,@xml_id,'}')"/>
  789. <factory name="net.sf.saxon.TransformerFactoryImpl">
  790. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  791. <!--<attribute name="http://saxon.sf.net/feature/initialMode"
  792. value="after_first_ant_assing_vars"/>-->
  793. </factory>
  794. <param name="temp" expression="{$temp}"/>
  795. <param name="loop_xpath_real" expression="{$loop_xpath_real}{@xml_id}"/>
  796. <param name="xpath_query_test.xml">
  797. <xsl:attribute name="expression" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_xpath_real,@xml_id,'}')"/>
  798. </param>
  799. <!--<param name="recurse_ant_basedir" expression="{$recurse_ant_basedir}"/>-->
  800. <!--<xsl:element name="param">
  801. <xsl:attribute name="name" select="'default_antfile'"/>
  802. <xsl:attribute name="expression" select="concat($temp,'/',$builds_to_ant_file.xml"/>
  803. </xsl:element>-->
  804. <param name="default_antfile" expression="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml"/>
  805. <param name="xpath_query" expression="{$xpath_query}"/> <!-- limit related TODO -->
  806. <!--<param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>-->
  807. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  808. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  809. </xsl:element>
  810. <!--<ant antfile="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>-->
  811. <xsl:element name="ant">
  812. <xsl:attribute name="antfile" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,@xml_id,'}')"/>
  813. </xsl:element>
  814. <!--<ant antfile="{$temp}/${builds_to_ant_file.xml}" dir="."/>-->
  815. </xsl:template>
  816. <xsl:template mode="place_subant" match="RelatedFeatureLoop">
  817. <xsl:param name="uuid" required="yes"/>
  818. <xsl:param name="loop_xpath" required="yes"/>
  819. <xsl:param name="loop_xpath_real" required="yes"/>
  820. <xsl:param name="xpath_dita" required="yes"/>
  821. <xsl:param name="xpath_value_dita" required="yes"/>
  822. <xsl:param name="featureID_name_dita" required="yes"/>
  823. <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
  824. <!-- wygenerujemy liste ant -->
  825. <xsl:comment>
  826. #590 LOOP BEGIN ; @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; </xsl:comment>
  827. <echo> #523 RelatedFeatureLoop @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; ant bede odpalac w podkatalogu:@xml_id=(<xsl:value-of select="@xml_id"/>)
  828. <xsl:value-of select="concat($temp,'/',@xml_id,'/',$uuid,'.build_',$loop_xpath_real,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/> </echo>
  829. <xsl:message>#591 todo executing by exec instead of ant without inheritAll because it's looping!!! </xsl:message>
  830. <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
  831. <echo>#684 dajemy wpis o walidacji danego feature pod katem xpath_query $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; </echo>
  832. <xsl:element name="tempfile">
  833. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita.xml',$loop_xpath_real,@xml_id)"/>
  834. <xsl:attribute name="deleteonexit" select="'no'"/>
  835. <xsl:attribute name="destdir" select="$temp"/>
  836. <xsl:attribute name="suffix" select="'.xml'"/>
  837. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-loop_test_featureID_name_dita',@xml_id,'-')"/>
  838. </xsl:element>
  839. <xsl:element name="echoxml">
  840. <xsl:attribute name="file" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_xpath_real,@xml_id,'}')"/>
  841. <xsl:element name="{$featureID_name_dita}"><xsl:attribute name="position" select="position()"/></xsl:element>
  842. </xsl:element>
  843. <xsl:element name="tempfile">
  844. <xsl:attribute name="property" select="concat('builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_xpath_real,@xml_id)"/>
  845. <xsl:attribute name="deleteonexit" select="'no'"/>
  846. <xsl:attribute name="destdir" select="$temp"/>
  847. <xsl:attribute name="suffix" select="'.xml'"/>
  848. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-loop_test_featureID_name_dita_out',@xml_id,'-')"/>
  849. </xsl:element>
  850. <xsl:element name="xslt">
  851. <xsl:attribute name="basedir" select="$temp"/>
  852. <xsl:attribute name="style" select="$xpath_query.xsl"/>
  853. <xsl:attribute name="in" select="concat('${builds_to_ant__test_query__featureID_name_dita.xml',$loop_xpath_real,@xml_id,'}')"/>
  854. <xsl:attribute name="destdir" select="$temp"/>
  855. <xsl:attribute name="out" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_xpath_real,@xml_id,'}')"/>
  856. <factory name="net.sf.saxon.TransformerFactoryImpl">
  857. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  858. <attribute name="http://saxon.sf.net/feature/initialMode" value="xpath_query_test"/>
  859. </factory>
  860. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  861. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  862. </xsl:element>
  863. <!-- Lista do wyzwolenia dzieci w podkalagach na bazie params-->
  864. <echo> #596 ant szukam fileset id=builds_to_ant w <xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.*.xml')"/> </echo>
  865. <dirset id="builds_to_ant{$loop_xpath_real}{@xml_id}" dir="{$temp}" includes="{@xml_id}.{$uuid}.*" />
  866. <property name="builds_to_ant{$loop_xpath_real}{@xml_id}" refid="builds_to_ant{$loop_xpath_real}{@xml_id}"/>
  867. <!--<tempfile property="builds_to_ant.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.builds_to_ant-"/>-->
  868. <xsl:element name="tempfile">
  869. <xsl:attribute name="property" select="concat('builds_to_ant.xml',$loop_xpath_real,@xml_id)"/>
  870. <xsl:attribute name="deleteonexit" select="'no'"/>
  871. <xsl:attribute name="destdir" select="$temp"/>
  872. <xsl:attribute name="suffix" select="'.xml'"/>
  873. <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-loop-',@xml_id,'-')"/>
  874. </xsl:element>
  875. <!--<tempfile property="builds_to_ant_file.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.build_to_ant_file-"/>-->
  876. <xsl:element name="tempfile">
  877. <xsl:attribute name="property" select="concat('builds_to_ant_file.xml',$loop_xpath_real,@xml_id)"/>
  878. <xsl:attribute name="deleteonexit" select="'no'"/>
  879. <xsl:attribute name="destdir" select="$temp"/>
  880. <xsl:attribute name="suffix" select="'.xml'"/>
  881. <xsl:attribute name="prefix" select="concat('${uuid}.build_to_ant_file-loop-',@xml_id,'-')"/>
  882. </xsl:element>
  883. <echo>#615 ant do: builds_to_ant.xml=${builds_to_ant_file.xml} mode="place_subant" match="RelatedFeature" </echo>
  884. <!--<echoxml file="'${builds_to_ant.xml}'"><builds_to_ant>${builds_to_ant}</builds_to_ant></echoxml>-->
  885. <xsl:element name="echoxml">
  886. <xsl:attribute name="file" select="concat('${builds_to_ant.xml',$loop_xpath_real,@xml_id,'}')"/>
  887. <builds_to_ant>${builds_to_ant<xsl:value-of select="concat($loop_xpath_real,@xml_id)"/>}</builds_to_ant>
  888. </xsl:element>
  889. <xsl:element name="xslt">
  890. <xsl:attribute name="basedir" select="$temp"/>
  891. <xsl:attribute name="style" select="$builds_to_ant.xsl"/>
  892. <xsl:attribute name="in" select="concat('${builds_to_ant.xml',$loop_xpath_real,@xml_id,'}')"/>
  893. <xsl:attribute name="destdir" select="$temp"/>
  894. <xsl:attribute name="out" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,@xml_id,'}')"/>
  895. <factory name="net.sf.saxon.TransformerFactoryImpl">
  896. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  897. <attribute name="http://saxon.sf.net/feature/initialMode" value="exec"/>
  898. </factory>
  899. <param name="temp" expression="{$temp}"/>
  900. <param name="loop_xpath_real" expression="{$loop_xpath_real}{@xml_id}"/>
  901. <param name="xpath_query_test.xml">
  902. <xsl:attribute name="expression" select="concat('${builds_to_ant__test_query__featureID_name_dita_out.xml',$loop_xpath_real,@xml_id,'}')"/>
  903. </param>
  904. <!--<xsl:element name="param">
  905. <xsl:attribute name="name" select="'default_antfile'"/>
  906. <xsl:attribute name="expression" select="concat($temp,'/',$builds_to_ant_file.xml"/>
  907. </xsl:element>-->
  908. <param name="default_antfile" expression="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml"/>
  909. <param name="xpath_query" expression="{$xpath_query}"/>
  910. <!--<param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>-->
  911. <param name="featureID_name_dita" expression="{$featureID_name_dita}"/>
  912. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  913. </xsl:element>
  914. <xsl:element name="ant">
  915. <xsl:attribute name="antfile" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,@xml_id,'}')"/>
  916. </xsl:element>
  917. <!-- EOF Lista do wyzwolenia dzieci -->
  918. <!--<exec command="/opt/local/bin/ant" dir="{$temp}" failifexecutionfails="true">
  919. <!-\-<arg line="-f ${builds_to_ant_file.xml}"/>-\->
  920. <xsl:element name="arg">
  921. <xsl:attribute name="line" select="concat('-f ',@xml_id,'/',$uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/>
  922. </xsl:element>
  923. </exec>-->
  924. <!--<xsl:element name="ant">
  925. <xsl:attribute name="antfile" select="concat($temp,'/',@xml_id,'/',$uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.1.xml')"/>
  926. <xsl:attribute name="inheritAll" select="'false'"/>
  927. <xsl:attribute name="inheritRefs" select="'false'"/>
  928. <property name="xpath" value="{$xpath_dita}"/>
  929. <property name="xpath_value_dita" value="{$xpath_value_dita}"/>
  930. </xsl:element>-->
  931. <!--<ant antfile="{$temp}/${builds_to_ant_file.xml}" dir="."/>-->
  932. <xsl:comment>#590 LOOP END
  933. </xsl:comment>
  934. </xsl:template>
  935. <xsl:template mode="place_subant" match="*">
  936. <xsl:param name="uuid" required="yes"/>
  937. <xsl:param name="loop_xpath" required="yes"/>
  938. <xsl:param name="loop_xpath_real" required="yes"/>
  939. <xsl:param name="xpath_dita" required="yes"/>
  940. <xsl:param name="xpath_value_dita" required="yes"/>
  941. <xsl:param name="featureID_name_dita" required="yes"/>
  942. <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
  943. <xsl:apply-templates mode="place_subant">
  944. <xsl:with-param name="uuid" select="$uuid"/>
  945. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  946. <xsl:with-param name="loop_xpath_real" select="$loop_xpath_real"/>
  947. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  948. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  949. <xsl:with-param name="featureID_name_dita" select="$featureID_name_dita"/>
  950. <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
  951. </xsl:apply-templates>
  952. </xsl:template>
  953. <xsl:template mode="place_subant" match="text()|comment()"/>
  954. <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 -->
  955. <xsl:param name="input_obj_with_xpath" required="yes"/>
  956. <xsl:param name="xpath" required="yes"/>
  957. <xsl:param name="xpath_value" required="yes"/>
  958. <xsl:variable name="xpath_value_token">
  959. <xsl:for-each select=" tokenize($xpath_value,'/')">
  960. <xsl:message>#341 znalazlem dla=<xsl:value-of select="."/>; ; <xsl:value-of select="$input_obj_with_xpath/node()[@xpath=current()]"/></xsl:message>
  961. <xsl:if test="$input_obj_with_xpath/node()[@xpath=current()]">
  962. <xsl:copy-of select="$input_obj_with_xpath/node()[@xpath=current()]"/>
  963. </xsl:if><!-- todo to jest bledne ale dziala tymczasowo-->
  964. </xsl:for-each>
  965. </xsl:variable>
  966. <xsl:message>#345 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message>
  967. <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
  968. <xsl:value-of select="$xpath_value_token"/>
  969. </xsl:template>
  970. <xsl:template match="RelatedFeature" mode="ant_target" >
  971. <xsl:param name="typeName_dita" required="yes"/>
  972. <xsl:param name="featureID_name_dita" required="yes"/>
  973. <xsl:param name="wfs_output" required="yes"/>
  974. <xsl:param name="wfs_output.xml" required="yes"/>
  975. <xsl:param name="wfs_output.dita" required="yes"/>
  976. <xsl:param name="xpath_dita" required="yes"/>
  977. <xsl:param name="xpath_value_dita" required="yes"/>
  978. <xsl:param name="xpath" required="yes"/>
  979. <xsl:param name="featureID_name" required="yes"/>
  980. <xsl:param name="RelatedFeatureCount" required="yes"/>
  981. <xsl:param name="RelatedFeaturePos" required="yes"/>
  982. <xsl:param name="typeName" required="yes"/>
  983. <xsl:param name="xpath_value" required="yes"/>
  984. <xsl:param name="loop_xpath" required="yes"/>
  985. <!--<xsl:param name="loop_xpath_save" required="yes"/>-->
  986. <xsl:param name="xml_id" required="yes"/>
  987. <xsl:param name="feature_pos" required="yes"/>
  988. <xsl:param name="loop_xpath_real" required="yes"/>
  989. <xsl:param name="input_obj_with_xpath" required="yes"/>
  990. <xsl:param name="typeNameRealResource" required="yes"/>
  991. <xsl:choose>
  992. <xsl:when test="$wfs_output"/>
  993. <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>
  994. </xsl:choose>
  995. <!-- template do przetworzenia dity w celu wykrycia:
  996. <RelatedFeature xpath="ID_BILLING_OWNER" typeName="p5_default_db:BILLING_OWNER">
  997. <ph>Nadawca:</ph><br/>
  998. <ph xpath="name1"/><br/>
  999. <ph xpath="name2"/><br/>
  1000. <ph xpath="miasto"/><br/>
  1001. <ph xpath="nr_rach"/><br/>
  1002. <ph xpath="BILLING_OWNER_EMAIL"/><br/>
  1003. </RelatedFeature>
  1004. i wyrzucenia z tego pierwszego zadania ANT do otrzymania niezbednego .xml w celu jego podstawienia pod dite
  1005. w celu pozniejszego ponownego wyzwolenia tego template az do zakonczenia cyklu finalnego.
  1006. Template powinien budować projekt ant do wyzwolenia z odpowiednimi parametrami dalszymi
  1007. -->
  1008. <!-- sprawdzamy czy template pasuje do zadania wyzwolenia czy xpath=xpath_dita oraz czy typeName=typeName_dita-->
  1009. <xsl:choose>
  1010. <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 -->
  1011. <!-- 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'-->
  1012. <!--<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>-->
  1013. <!--<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>-->
  1014. <!--<xsl:variable name="OGC_Filter">
  1015. <xsl:choose>
  1016. <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>
  1017. <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>
  1018. </xsl:choose>
  1019. </xsl:variable>-->
  1020. <xsl:variable name="OGC_Filter">
  1021. <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
  1022. <xsl:with-param name="simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
  1023. <xsl:with-param name="RelatedFilter" select="RelatedFilter"/>
  1024. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  1025. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  1026. </xsl:call-template>
  1027. </xsl:variable>
  1028. <xsl:message>#410 final OGC_Filter is <xsl:value-of select="$OGC_Filter"/>;</xsl:message>
  1029. <xsl:variable name="url">
  1030. <!--<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"/>-->
  1031. <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"/>
  1032. </xsl:variable>
  1033. <xsl:element name="target">
  1034. <xsl:attribute name="name" select="concat('get_related_feature.',position(),$loop_xpath_real)"/>
  1035. <xsl:choose>
  1036. <xsl:when test="$RelatedFeatureCount=$RelatedFeaturePos"/>
  1037. <xsl:otherwise>
  1038. <xsl:attribute name="depends" select="concat('get_related_feature.',position()-1),$loop_xpath_real"/>
  1039. </xsl:otherwise>
  1040. </xsl:choose>
  1041. <echo>#1084 exec curl for $typeNameRealResource=<xsl:value-of select="$typeNameRealResource"/> 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"/>;
  1042. $url=<xsl:value-of select="$url"/>;</echo>
  1043. <!--<tempfile property="out_task.dita" deleteonexit="no" destdir="temp"/>-->
  1044. <!--<tempfile property="wfs_output" deleteonexit="no" destdir="temp" suffix=".xml" />-->
  1045. <xsl:element name="exec">
  1046. <xsl:attribute name="executable" select="'curl'"/>
  1047. <xsl:attribute name="output" select="concat($temp,'/',$wfs_output.xml)"/>
  1048. <xsl:attribute name="errorproperty" select="'wfs_error'"/>
  1049. <xsl:attribute name="resultproperty" select="'wfs_result'"/>
  1050. <xsl:element name="arg">
  1051. <!--<xsl:attribute name="line" select='concat("-H ","&amp;Authorization: Basic ",$passwordBase64Basic," ",$url)'/>-->
  1052. <!--<xsl:attribute name="line">-H 'Authorization: Basic <xsl:value-of select="$passwordBase64Basic"/>' "<xsl:value-of select="$url"/>"</xsl:attribute>-->
  1053. <xsl:attribute name="line"> <xsl:value-of select="$cookie_curl_option"/> "<xsl:value-of select="$url"/>"</xsl:attribute>
  1054. </xsl:element>
  1055. </xsl:element>
  1056. <echo message="ERROR__START"/>
  1057. <xsl:element name="echo">
  1058. <xsl:attribute name="message">${wfs_error}</xsl:attribute>
  1059. </xsl:element>
  1060. <echo message="ERROR__END"/>
  1061. <xsl:choose>
  1062. <xsl:when test="position()=last()">
  1063. <xsl:comment>antcall target="build_recurse_ant.<xsl:value-of select="position()+1"/>.xml"</xsl:comment>
  1064. </xsl:when>
  1065. <xsl:otherwise>
  1066. <antcall target="build_recurse_ant.{position()+1}.xml"/>
  1067. </xsl:otherwise>
  1068. </xsl:choose>
  1069. <echo>#1119 related .dita.xml template is: $wfs_output.dita=<xsl:value-of select="$wfs_output.dita"/>; do przetwarzania na podstawie: $wfs_output.xml=<xsl:value-of select="$wfs_output.xml"/>;
  1070. $temp is <xsl:value-of select="$temp"/>;</echo>
  1071. <xsl:comment> teraz podmieniamy dane z otrzymanego xmla do pliku dita aby potem zrobic polaczony plik w kolejnym wyzwoleniu ant</xsl:comment>
  1072. <delete file="{$temp}/{$wfs_output.dita}.vals.dita"/>
  1073. <xslt basedir="." style="{$build_recurse_ant.xsl}" in="{$temp}/{$wfs_output.dita}" destdir="./" out="{$temp}/{$wfs_output.dita}.vals.dita" >
  1074. <factory name="net.sf.saxon.TransformerFactoryImpl">
  1075. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  1076. <attribute name="http://saxon.sf.net/feature/initialMode" value="after_first_ant_assing_vars"/>
  1077. </factory>
  1078. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  1079. <param name="wfs_output" expression="{$temp}/{$wfs_output.xml}"/>
  1080. <param name="xpath" expression="{$xpath}" /> <!-- kontrolnie - nie potrzebne -->
  1081. <param name="xpath_value" expression="{$xpath_value}" /> <!-- kontrolnie - nie potrzebne -->
  1082. <param name="loop_xpath" expression="{$loop_xpath}"/>
  1083. <param name="loop_xpath_save" expression="{$loop_xpath_save}"/>
  1084. <param name="typeName" expression="{$typeName}"/><!-- kontrolnie - nie potrzebne -->
  1085. <param name="uuid" expression="{$uuid}"/>
  1086. <param name="basedir" expression="{$basedir}"/>
  1087. <param name="recurse_ant_basedir" expression="{$recurse_ant_basedir}"/>
  1088. <param name="recurse_ant_basedir.temp" expression="{$recurse_ant_basedir.temp}"/>
  1089. <param name="recurse_ant" expression="{$recurse_ant}"/>
  1090. <param name="build_recurse_ant.xsl" expression="{$build_recurse_ant.xsl}"/>
  1091. <param name="passwordBase64Basic" expression="{$passwordBase64Basic}"/>
  1092. <param name="feature_pos" expression="{$feature_pos}"/> <!-- aby wsadzic nr wezla do $wfs_output.dita.vals.dita -->
  1093. <param name="temp" expression="{$temp}"/>
  1094. <param name="builds_to_ant.xsl" expression="{$builds_to_ant.xsl}"/>
  1095. <param name="cookie_curl_option" expression="{$cookie_curl_option}"/>
  1096. <param name="api_url" expression="{$api_url}"/>
  1097. <param name="loop_path_recurs" expression="{$loop_path_recurs}"/>
  1098. <param name="ignore_maxOccurs_0" expression="{$ignore_maxOccurs_0}"/>
  1099. <param name="xpath_query" expression="{$xpath_query}"/>
  1100. <param name="xpath_query.xsl" expression="{$xpath_query.xsl}"/>
  1101. <param name="empty.xml" expression="{$empty.xml}"/>
  1102. <param name="simpleSchema_dir" expression="{$simpleSchema_dir}"/>
  1103. <param name="default_db_xml_cache.public" expression="{$default_db_xml_cache.public}"/>
  1104. </xslt>
  1105. </xsl:element>
  1106. <!-- zapisujemy wynik naszego biezacego przetwarzania dita element nizej do kolejnego przejechania z ant wyniku dla podstawienia danych -->
  1107. <!-- blad - result jest po tym template -->
  1108. <xsl:message>#276 $feature_pos=<xsl:value-of select="$feature_pos"/>; $xml_id=<xsl:value-of select="$xml_id"/>; writing $wfs_output.dita to <xsl:value-of select="$wfs_output.dita"/>;</xsl:message>
  1109. <!-- ten plik moze byc raz bo zawiera tylko mape do przeksztalcenia danego wezla -->
  1110. <xsl:result-document href="{$wfs_output.dita}">
  1111. <xsl:comment>current $feature_pos=<xsl:value-of select="$feature_pos"/>; $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:comment>
  1112. <!--<xsl:copy-of select="."/>-->
  1113. <xsl:element name="{name()}">
  1114. <xsl:copy-of select="@*"/>
  1115. <xsl:attribute name="feature_pos" select="$feature_pos"/>
  1116. <xsl:copy-of select="./*" exclude-result-prefixes="#all" copy-namespaces="no"/>
  1117. </xsl:element>
  1118. </xsl:result-document>
  1119. <!--<xsl:choose>
  1120. <xsl:when test="$feature_pos=1"><xsl:message>#327 propably first unaviable (<xsl:value-of select="$wfs_output.dita"/>) - writing</xsl:message>
  1121. <xsl:result-document href="{$wfs_output.dita}">
  1122. <xsl:comment>current $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:comment>
  1123. <xsl:copy-of select="."/></xsl:result-document>
  1124. </xsl:when>
  1125. <xsl:otherwise>
  1126. <xsl:message>#227.1 probably exists file:<xsl:value-of select="$wfs_output.dita"/>; - bypassing </xsl:message>
  1127. </xsl:otherwise>
  1128. </xsl:choose>-->
  1129. </xsl:when>
  1130. <xsl:otherwise>
  1131. <error>
  1132. <xsl:attribute name="xpath" select="$xpath"/>
  1133. <xsl:attribute name="xpath_dita" select="$xpath_dita"/>
  1134. <xsl:attribute name="xpath_value" select="$xpath_value"/>
  1135. <xsl:attribute name="xpath_value_dita" select="$xpath_value_dita"/>
  1136. <xsl:attribute name="typeName" select="$typeName"/>
  1137. <xsl:attribute name="typeName_dita" select="$typeName_dita"/>
  1138. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  1139. <xsl:attribute name="featureID_name_dita" select="$featureID_name_dita"/>
  1140. <echo message="OUTPUT__START"/>
  1141. <echo>
  1142. 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"/>)
  1143. </echo>
  1144. <echo message="OUTPUT__END"/>
  1145. </error>
  1146. </xsl:otherwise>
  1147. </xsl:choose>
  1148. </xsl:template>
  1149. <xsl:template name="simpleTypeMakeOgcFilter_merge"><!-- do zrobienia polaczonego filtru OGC -->
  1150. <xsl:param name="simpleTypeMakeOgcFilter" required="yes"/>
  1151. <xsl:param name="xpath_dita" required="yes"/>
  1152. <xsl:param name="xpath_value_dita" required="yes"/>
  1153. <xsl:param name="RelatedFilter"/>&amp;Filter=&lt;ogc:Filter&gt;&lt;ogc:And&gt;<xsl:choose><xsl:when test="$RelatedFilter"><xsl:message>#406 we are enabling RelatedFilter <xsl:copy-of select="$RelatedFilter" copy-namespaces="no"/></xsl:message>&lt;ogc:And&gt;&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;<xsl:for-each select="$RelatedFilter">&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="@xpath"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="@xpath_value"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:for-each>&lt;/ogc:And&gt;</xsl:when><xsl:otherwise>&lt;ogc:PropertyIsEqualTo&gt;&lt;ogc:PropertyName&gt;<xsl:value-of select="$xpath_dita"/>&lt;/ogc:PropertyName&gt;&lt;ogc:Literal&gt;<xsl:value-of select="$xpath_value_dita"/>&lt;/ogc:Literal&gt;&lt;/ogc:PropertyIsEqualTo&gt;</xsl:otherwise></xsl:choose><xsl:if test="$simpleTypeMakeOgcFilter">&lt;ogc:Or&gt;<!--<xsl: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;</xsl:template>
  1154. <!-- second step from local ant leaf -->
  1155. <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
  1156. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1157. <RelatedFeatureRoot>
  1158. <xsl:message>#228 @xml_id=<xsl:value-of select="@xml_id"/>; templ match RelatedFeature mode after_first_ant_assing_vars dla @typeName=<xsl:value-of select="@typeName"/>; try to open $wfs_output=doc(<xsl:value-of select="$wfs_output"/>); </xsl:message>
  1159. <!-- first assign xpath to features from -->
  1160. <xsl:variable name="wfs_output_nodes" select="doc($wfs_output)"/>
  1161. <xsl:variable name="current_RelatedFeature" select="*"/>
  1162. <xsl:variable name="xml_id" select="@xml_id"/>
  1163. <!--<input_obj_with_xpath_debug>
  1164. <xsl:copy-of select="$wfs_output_nodes"/>
  1165. </input_obj_with_xpath_debug>-->
  1166. <xsl:message>#354 count($wfs_output_nodes//gml:featureMember) <xsl:value-of select="count($wfs_output_nodes//gml:featureMember)"/></xsl:message>
  1167. <!-- tutaj jest blad przetwarzania ze wrzuca po rekordzie do kolumny - trzeba przetworzyc dla kazdego feature member -->
  1168. <xsl:for-each select="$wfs_output_nodes//gml:featureMember">
  1169. <xsl:variable name="input_obj_with_xpath">
  1170. <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -->
  1171. </xsl:variable>
  1172. <!--<input_obj_with_xpath_debug>
  1173. <xsl:attribute name="xpath" select="$xpath"/>
  1174. <!-\-<xsl:attribute name="xpath_dita" select="$xpath_dita"/>-\->
  1175. <xsl:attribute name="xpath_value" select="$xpath_value"/>
  1176. <!-\-<xsl:attribute name="xpath_value_dita" select="$xpath_value_dita"/>-\->
  1177. <xsl:attribute name="typeName" select="$typeName"/>
  1178. <!-\-<xsl:attribute name="typeName_dita" select="$typeName_dita"/>-\->
  1179. <!-\-<xsl:attribute name="featureID_name" select="$featureID_name"/>-\->
  1180. <!-\-<xsl:attribute name="featureID_name_dita" select="$featureID_name_dita"/>-\->
  1181. <xsl:copy-of select="$input_obj_with_xpath"/>
  1182. </input_obj_with_xpath_debug>-->
  1183. <!--<input_node_debug>
  1184. <xsl:copy-of select="."/>
  1185. </input_node_debug>-->
  1186. <xsl:apply-templates mode="after_first_ant_assing_vars_childs" select="$current_RelatedFeature">
  1187. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  1188. <xsl:with-param name="xml_id_parent" select="$xml_id"/>
  1189. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1190. <xsl:with-param name="feature_pos" select="position()"/><!-- wiecej features z relacji dokladamy pozycje -->
  1191. </xsl:apply-templates>
  1192. </xsl:for-each>
  1193. </RelatedFeatureRoot>
  1194. </xsl:template>
  1195. <xsl:template match="wfs:FeatureCollection|gml:featureMember" mode="after_first_ant_assing_xpath">
  1196. <xsl:apply-templates mode="after_first_ant_assing_xpath"/>
  1197. </xsl:template>
  1198. <xsl:template mode="after_first_ant_assing_xpath" match="*">
  1199. <xsl:param name="curr_xpath"/>
  1200. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1201. <xsl:choose>
  1202. <xsl:when test="name()=$typeName">
  1203. <xsl:apply-templates mode="after_first_ant_assing_xpath">
  1204. <xsl:with-param name="curr_xpath" select="$curr_xpath"/>
  1205. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1206. </xsl:apply-templates>
  1207. </xsl:when>
  1208. <xsl:otherwise>
  1209. <xsl:variable name="curr_xpath_tmpl">
  1210. <xsl:choose>
  1211. <xsl:when test="$curr_xpath=''">
  1212. <xsl:value-of select="local-name()"/> <!-- bylo local-name() - trzeba dorzucic xpath przechodzacy aby budowal sie w kwestii -->
  1213. </xsl:when>
  1214. <xsl:otherwise>
  1215. <xsl:value-of select="concat($curr_xpath,'/',local-name())"/>
  1216. </xsl:otherwise>
  1217. </xsl:choose>
  1218. </xsl:variable>
  1219. <!--<xsl:variable name="curr_xpath_tmpl" select="'asdf'"/>-->
  1220. <xsl:element name="{name()}">
  1221. <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
  1222. <xsl:for-each select="@*">
  1223. <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
  1224. </xsl:for-each>
  1225. <xsl:value-of select="text()"/>
  1226. <xsl:apply-templates mode="after_first_ant_assing_xpath">
  1227. <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
  1228. </xsl:apply-templates>
  1229. </xsl:element>
  1230. </xsl:otherwise>
  1231. </xsl:choose>
  1232. </xsl:template>
  1233. <xsl:template match="text()" mode="after_first_ant_assing_xpath"/>
  1234. <xsl:template match="simpleTypeMakeOgcFilter" mode="after_first_ant_assing_vars_childs">
  1235. <xsl:message>#621 bypassing simpleTypeMakeOgcFilter in after_first_ant_assing_vars_childs</xsl:message>
  1236. </xsl:template>
  1237. <!-- przetwarzanie kolejne w celu podstawienia wartosci i wystawienia build dla kolejnych wezlow - problem z obsluga rownorzednie zagniezdzonych wezlow poprzez inne wezly -->
  1238. <xsl:template match="*" mode="after_first_ant_assing_vars_childs">
  1239. <xsl:param name="xml_id_parent" required="yes"/>
  1240. <xsl:param name="loop_xpath" required="yes"/>
  1241. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1242. <xsl:param name="feature_pos" required="yes"/>
  1243. <xsl:for-each select=".">
  1244. <xsl:choose>
  1245. <!--<xsl:when test="node()='topic'">asdad</xsl:when>-->
  1246. <!--<xsl:when test="name()='RelatedFeature'">
  1247. <xsl:for-each select="data/apiname[@base='PROCES_INCLUDE']">
  1248. <xsl:apply-templates mode="PROCES_INCLUDE">
  1249. <xsl:with-param name="ID_PROCES" select="text()"/>
  1250. </xsl:apply-templates>
  1251. </xsl:for-each>
  1252. </xsl:when>-->
  1253. <!--<xsl:when test="name()='data-about'">
  1254. <xsl:for-each select="data/apiname[@base='PROCES_INCLUDE']">
  1255. <xsl:apply-templates mode="PROCES_INCLUDE">
  1256. <xsl:with-param name="ID_PROCES" select="text()"/>
  1257. </xsl:apply-templates>
  1258. </xsl:for-each>
  1259. </xsl:when>-->
  1260. <xsl:when test="1=2"/>
  1261. <xsl:otherwise>
  1262. <xsl:element name="{name()}">
  1263. <!--<xsl:copy-of select="namespace::node()"/>-->
  1264. <xsl:for-each select="@*">
  1265. <xsl:choose>
  1266. <xsl:when test="name()='xpath'">
  1267. <!--<xsl:attribute name="xpath_parsed" select="."/>-->
  1268. <!--1:<xsl:value-of select="$parent_obj//node()[@system_cache__appinfo:xpath=$xpath]/text()"/>-->
  1269. <!--<xsl:value-of select="$parent_obj//node()[local-name()=$xpath]/text()"/>-->
  1270. <!--V:<xsl:value-of select="$xpath"/>-->
  1271. </xsl:when>
  1272. <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
  1273. </xsl:choose>
  1274. </xsl:for-each>
  1275. <xsl:choose>
  1276. <xsl:when test="@xpath">
  1277. <!--<xsl:variable name="escaped_html_to_xml">
  1278. <xsl:call-template name="system_cache__appinfo:escaped_html_to_xml">
  1279. <xsl:with-param name="html" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
  1280. </xsl:call-template>
  1281. </xsl:variable>-->
  1282. <xsl:variable name="enter_to_ph">
  1283. <xsl:apply-templates mode="enter_to_ph" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]">
  1284. <xsl:with-param name="count" select="count($input_obj_with_xpath/node()[local-name()=current()/@xpath])"/>
  1285. <xsl:with-param name="element" select="name()"/>
  1286. <!--<xsl:with-param name="xpath_token_filter" select="@xpath_token_filter"/>--><!-- mozliwosc wybrania pierwszego wyrazu np ' ' -->
  1287. <!--<xsl:with-param name="xpath_token" select="@xpath_token"/>--><!-- mozliwosc wybrania pierwszego wyrazu np 1 -->
  1288. </xsl:apply-templates>
  1289. </xsl:variable>
  1290. <xsl:variable name="enter_to_ph">
  1291. <xsl:choose>
  1292. <xsl:when test="@xpath_token_filter and @xpath_token ">
  1293. <!-- implementacja filtra dla czegos oddzielonego parametrem -->
  1294. <xsl:variable name="xpath_token_filter" select="tokenize($enter_to_ph,@xpath_token_filter)"/>
  1295. <xsl:for-each select=" tokenize(@xpath_token,' ')">
  1296. <xsl:variable name="xpath_token" select="number(.)"/>
  1297. <xsl:copy-of select="$xpath_token_filter[$xpath_token]"></xsl:copy-of>
  1298. </xsl:for-each>
  1299. </xsl:when>
  1300. <xsl:otherwise>
  1301. <xsl:copy-of select="$enter_to_ph"/>
  1302. </xsl:otherwise>
  1303. </xsl:choose>
  1304. </xsl:variable>
  1305. <xsl:copy-of select="$enter_to_ph"/>
  1306. </xsl:when>
  1307. </xsl:choose>
  1308. <xsl:value-of select="text()"/>
  1309. <xsl:apply-templates mode="after_first_ant_assing_vars_childs">
  1310. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  1311. <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
  1312. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1313. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  1314. </xsl:apply-templates>
  1315. </xsl:element>
  1316. </xsl:otherwise>
  1317. </xsl:choose>
  1318. </xsl:for-each>
  1319. </xsl:template>
  1320. <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars_childs">
  1321. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1322. <xsl:param name="xml_id_parent" required="yes"/>
  1323. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1324. <xsl:param name="feature_pos" required="yes"/>
  1325. <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>
  1326. <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
  1327. <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
  1328. <xsl:variable name="xml_id" select="@xml_id"/>
  1329. <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
  1330. <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
  1331. <!--<debug_358_RelatedFeature>
  1332. <xsl:copy-of select="$input_obj_with_xpath"/>
  1333. </debug_358_RelatedFeature>-->
  1334. <!--<xsl:variable name="feature_pos">
  1335. <xsl:choose>
  1336. <xsl:when test="$feature_pos=1"/>
  1337. <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
  1338. </xsl:choose>
  1339. </xsl:variable>-->
  1340. <xsl:variable name="test_xpath_query">
  1341. <xsl:call-template name="test_xpath_query">
  1342. <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
  1343. <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
  1344. <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
  1345. <xsl:with-param name="xpath_query" select="$xpath_query"/>
  1346. </xsl:call-template>
  1347. </xsl:variable>
  1348. <xsl:choose>
  1349. <xsl:when test="$test_xpath_query='1'">
  1350. <xsl:message>#389 jest okazja do zrobienia bilda $feature_pos=<xsl:value-of select="$feature_pos"/> $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>; result-document=<xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'.xml')"/> match=RelatedFeature mode=after_first_ant_assing_vars_childs </xsl:message>
  1351. <xsl:result-document href="{$temp}/{$uuid}.build_{$loop_xpath}.{$feature_pos}.xml">
  1352. <xsl:apply-templates select=".">
  1353. <xsl:with-param name="typeName" select="@typeName"/>
  1354. <xsl:with-param name="xpath" select="@xpath"/>
  1355. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  1356. <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
  1357. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  1358. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1359. <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
  1360. <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
  1361. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  1362. <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
  1363. <!--<xsl:with-param name="wfs_output.xml" />-->
  1364. </xsl:apply-templates>
  1365. </xsl:result-document>
  1366. <xsl:element name="RelatedFeature">
  1367. <xsl:copy-of select="@*"/>
  1368. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  1369. <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
  1370. </xsl:element>
  1371. </xsl:when>
  1372. <xsl:otherwise>
  1373. <xsl:message terminate="no">#389b
  1374. #
  1375. #
  1376. #
  1377. 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
  1378. #
  1379. #</xsl:message>
  1380. </xsl:otherwise>
  1381. </xsl:choose>
  1382. </xsl:template>
  1383. <xsl:template match="RelatedFeatureLoop" mode="after_first_ant_assing_vars_childs">
  1384. <xsl:param name="input_obj_with_xpath" required="yes"/>
  1385. <xsl:param name="xml_id_parent" required="yes"/>
  1386. <xsl:param name="loop_xpath" select="$loop_xpath"/>
  1387. <xsl:param name="feature_pos" required="yes"/>
  1388. <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>
  1389. <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
  1390. <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
  1391. <xsl:variable name="xml_id" select="@xml_id"/>
  1392. <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
  1393. <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
  1394. <!--<debug_358_RelatedFeature>
  1395. <xsl:copy-of select="$input_obj_with_xpath"/>
  1396. </debug_358_RelatedFeature>-->
  1397. <!--<xsl:variable name="feature_pos">
  1398. <xsl:choose>
  1399. <xsl:when test="$feature_pos=1"/>
  1400. <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
  1401. </xsl:choose>
  1402. </xsl:variable>-->
  1403. <xsl:message>#832 RelatedFeatureLoop jest okazja do zrobienia bilda $feature_pos=<xsl:value-of select="$feature_pos"/> $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>; result-document=<xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'.xml')"/> match=RelatedFeature mode=after_first_ant_assing_vars_childs </xsl:message>
  1404. <xsl:variable name="loop_path_recurs">
  1405. <xsl:choose>
  1406. <xsl:when test=" string-length($loop_path_recurs) &lt;1">
  1407. <xsl:value-of select="concat('/',@xml_id,'.',$uuid,'.',$feature_pos)"/>
  1408. </xsl:when>
  1409. <xsl:otherwise><xsl:value-of select="concat($loop_path_recurs,'/',@xml_id,'.',$uuid,'.',$feature_pos)"/></xsl:otherwise>
  1410. </xsl:choose>
  1411. </xsl:variable>
  1412. <xsl:variable name="test_xpath_query">
  1413. <xsl:call-template name="test_xpath_query">
  1414. <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
  1415. <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
  1416. <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
  1417. <xsl:with-param name="xpath_query" select="$xpath_query"/>
  1418. </xsl:call-template>
  1419. </xsl:variable>
  1420. <xsl:choose>
  1421. <xsl:when test="$test_xpath_query='1'">
  1422. <xsl:result-document href="{$temp}/{@xml_id}.{$uuid}.{$feature_pos}/build_root.xml" >
  1423. <xsl:apply-templates select=".">
  1424. <xsl:with-param name="typeName" select="@typeName"/>
  1425. <xsl:with-param name="xpath" select="@xpath"/>
  1426. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  1427. <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
  1428. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  1429. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  1430. <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
  1431. <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
  1432. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  1433. <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
  1434. <!--<xsl:with-param name="wfs_output.xml" />-->
  1435. </xsl:apply-templates>
  1436. </xsl:result-document>
  1437. <xsl:element name="RelatedFeatureLoop">
  1438. <xsl:copy-of select="@*"/>
  1439. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  1440. <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
  1441. </xsl:element>
  1442. </xsl:when>
  1443. <xsl:otherwise>
  1444. <xsl:message terminate="no">#1263
  1445. #
  1446. #
  1447. #
  1448. 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
  1449. #
  1450. #</xsl:message>
  1451. </xsl:otherwise>
  1452. </xsl:choose>
  1453. </xsl:template>
  1454. <xsl:template match="text()" mode="after_first_ant_assing_vars_childs"/>
  1455. <xsl:template match="comment()" mode="after_first_ant_assing_vars_childs"/>
  1456. <!-- pozbieranie do kupy wszystkich xmli i zlozenie dity -->
  1457. <xsl:template match="*" mode="enter_to_ph">
  1458. <xsl:param name="count"/>
  1459. <xsl:param name="element"/>
  1460. <xsl:variable name="current" select="."/>
  1461. <xsl:variable name="surround_with">
  1462. <xsl:choose>
  1463. <xsl:when test="$element='p'"><xsl:value-of select="'codeblock'"/></xsl:when>
  1464. <xsl:when test="$element='bodydiv'"><xsl:value-of select="'p'"/></xsl:when>
  1465. <xsl:otherwise><xsl:value-of select="'codeblock'"/></xsl:otherwise>
  1466. </xsl:choose>
  1467. </xsl:variable>
  1468. <xsl:choose>
  1469. <xsl:when test=" contains( text(),'&#13;')">
  1470. <xsl:for-each select="tokenize( text(),'&#13;')">
  1471. <xsl:element name="{$surround_with}"><!-- to jest przetwarzane jak jest tekst lamany -->
  1472. <xsl:value-of select="."/>
  1473. </xsl:element>
  1474. </xsl:for-each>
  1475. </xsl:when>
  1476. <xsl:otherwise>
  1477. <xsl:choose>
  1478. <xsl:when test="$count &gt;1">
  1479. <codeblock>
  1480. <!--<xsl:attribute name="DDxpath" select="@xpath"/>-->
  1481. <!--DN(<xsl:value-of select="$element"/>)-->
  1482. <!--count:<xsl:value-of select="$count"/>-->
  1483. <xsl:copy-of select=" text()"/>
  1484. </codeblock>
  1485. </xsl:when>
  1486. <xsl:otherwise>
  1487. <xsl:apply-templates mode="enter_to_ph_text">
  1488. <xsl:with-param name="element" select="$element"/>
  1489. </xsl:apply-templates>
  1490. <!--<xsl:copy-of select=" text()"/>-->
  1491. </xsl:otherwise>
  1492. </xsl:choose>
  1493. </xsl:otherwise>
  1494. </xsl:choose>
  1495. </xsl:template>
  1496. <!-- dodanie enterow dla tabel w ktorych wyrazy sa dluzsze niz 10 znakow -->
  1497. <xsl:template match="text()" mode="enter_to_ph_text">
  1498. <xsl:param name="element" required="yes"/>
  1499. <xsl:choose>
  1500. <xsl:when test="$element='entry'">
  1501. <xsl:for-each select="tokenize(.,' ')">
  1502. <xsl:value-of select="' '"/>
  1503. <xsl:variable name="phrase" select="."/>
  1504. <xsl:for-each select="1 to string-length(.)">
  1505. <xsl:if test="position() mod 12 = 0"><xsl:value-of select="' -'"/></xsl:if>
  1506. <xsl:value-of select="substring($phrase,position(),1)"/>
  1507. </xsl:for-each>
  1508. </xsl:for-each>
  1509. </xsl:when>
  1510. <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
  1511. </xsl:choose>
  1512. </xsl:template>
  1513. <xsl:template name="test_xpath_query">
  1514. <!-- to verify if retrieve some node based on user requested tree limit filter -->
  1515. <xsl:param name="ignore_maxOccurs_0" required="yes"/>
  1516. <xsl:param name="xpath_query" required="yes"/>
  1517. <xsl:param name="featureID_name_dita" required="yes"/>
  1518. <xsl:param name="system_cache__appinfo:maxOccurs" required="yes"/>
  1519. <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>
  1520. <xsl:if test="$ignore_maxOccurs_0"><xsl:message terminate="no">#1344 test igrnore is true()=<xsl:value-of select="$ignore_maxOccurs_0"/>;</xsl:message></xsl:if>
  1521. <xsl:variable name="TestMaxOccurs">
  1522. <xsl:choose>
  1523. <xsl:when test="$system_cache__appinfo:maxOccurs='0' and $ignore_maxOccurs_0"></xsl:when>
  1524. <xsl:otherwise>1</xsl:otherwise>
  1525. </xsl:choose>
  1526. </xsl:variable>
  1527. <xsl:value-of select="$TestMaxOccurs"/>
  1528. </xsl:template>
  1529. </xsl:stylesheet>