build_recurse_ant.xsl 118 KB

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