build_recurse_ant.xsl 121 KB

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