get_wfs_recurse_xsl.xsl 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  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:wfs="http://www.opengis.net/wfs"
  5. xmlns:gml="http://www.opengis.net/gml"
  6. xmlns:ogc="http://www.opengis.net/ogc"
  7. xmlns:get_wfs_recurse_xsl="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/get_wfs_recurse_xsl.xsd"
  8. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  9. xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
  10. exclude-result-prefixes="xs"
  11. version="2.0">
  12. <!-- TESTING for recurse get WFS using xsd schemas and/or retrieved xlinks -->
  13. <xsl:output indent="yes"/>
  14. <xsl:strip-space elements="*"/>
  15. <xsl:param name="typeName" select="'p5_default_db:PROCES_INIT'"/>
  16. <xsl:param name="xpath" select="'ID'"/>
  17. <xsl:param name="xpath_value" select="'994'"/>
  18. <xsl:param name="uuid" select="'PROCES_INIT_PID_994_ALL_test'"/>
  19. <!--<xsl:param name="procesy5_system_schema_file" required="yes"/>-->
  20. <!--<xsl:param name="vrtfNamespaces_file" required="yes"/>-->
  21. <xsl:param name="username" select="'a.binder'"/>
  22. <xsl:param name="username.pass" required="yes"/>
  23. <xsl:param name="simpleSchema_dir" required="yes"/>
  24. <xsl:param name="targetNamespace_DEFAULTS_prefix" select="'default_db'"/> <!-- TODO should be detected -->
  25. <xsl:param name="debug" select="1"/>
  26. <xsl:param name="api" select="'biuro.biall-net.pl/SE/version-git/wfs-data.php'"/>
  27. <xsl:param name="protocol" select="'https://'"/>
  28. <!--<xsl:variable name="vrtfNamespaces" select="doc($vrtfNamespaces_file)"/>
  29. <xsl:variable name="procesy5_system_schema" select="doc($procesy5_system_schema_file)"/>
  30. -->
  31. <xsl:param name="ignore_maxOccurs_0" select="'1'"/>
  32. <xsl:function name="get_wfs_recurse_xsl:GetsimpleSchema">
  33. <xsl:param name="typeNameRealResource"/>
  34. <xsl:variable name="featureID_name_dita" select="substring-after($typeNameRealResource,':')"/>
  35. <xsl:variable name="simpleSchemaFile" select="concat($simpleSchema_dir,'/',$targetNamespace_DEFAULTS_prefix,'/',$featureID_name_dita,'.xml')"/>
  36. <xsl:message>get_wfs_recurse_xsl:GetsimpleSchema: <xsl:value-of select="$simpleSchemaFile"/></xsl:message>
  37. <xsl:copy-of select="doc($simpleSchemaFile)"/>
  38. </xsl:function>
  39. <xsl:function name="get_wfs_recurse_xsl:typeNameRealResource">
  40. <xsl:param name="get_wfs_recurse_xsl:GetsimpleSchema"/>
  41. <xsl:value-of select="$get_wfs_recurse_xsl:GetsimpleSchema/RelatedFeature/@typeNameRealResource"/>
  42. </xsl:function>
  43. <xsl:function name="get_wfs_recurse_xsl:RelatedFilter">
  44. <xsl:param name="get_wfs_recurse_xsl:GetsimpleSchema"/>
  45. <xsl:value-of select="$get_wfs_recurse_xsl:GetsimpleSchema/(RelatedFeatureRoot|RelatedFeature)/RelatedFilter"/>
  46. </xsl:function>
  47. <xsl:function name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter">
  48. <xsl:param name="get_wfs_recurse_xsl:GetsimpleSchema"/>
  49. <xsl:copy-of select="$get_wfs_recurse_xsl:GetsimpleSchema/RelatedFeature/simpleTypeMakeOgcFilter"/>
  50. </xsl:function>
  51. <xsl:function name="get_wfs_recurse_xsl:xpath_dita">
  52. <xsl:param name="xpath"/>
  53. <xsl:param name="get_wfs_recurse_xsl:xpath"/>
  54. <xsl:choose>
  55. <xsl:when test=" string-length($get_wfs_recurse_xsl:xpath) &gt;0">
  56. <xsl:value-of select="$get_wfs_recurse_xsl:xpath"/>
  57. <xsl:if test="$debug &gt; 2"><xsl:message>#121 narzucam $xpath=(<xsl:value-of select="$get_wfs_recurse_xsl:xpath"/>) z wyzwolenia build.xml </xsl:message></xsl:if>
  58. </xsl:when>
  59. <xsl:otherwise><xsl:value-of select="$xpath"/></xsl:otherwise>
  60. </xsl:choose>
  61. </xsl:function>
  62. <xsl:function name="get_wfs_recurse_xsl:xpath_value_dita">
  63. <xsl:param name="xpath"/>
  64. <xsl:param name="xpath_value"/>
  65. <!--<xsl:param name="get_wfs_recurse_xsl:xpath_value"/>-->
  66. <xsl:param name="input_obj_with_xpath"/>
  67. <xsl:variable name="get_wfs_recurse_xsl:xpath_value_dita">
  68. <xsl:choose>
  69. <xsl:when test="$xpath_value">
  70. <!--<xsl:variable name="xpath_value_tokens" select="tokenize(@xpath_value,'/')"/>-->
  71. <!--<xsl:value-of select="'todo zapytanie xpath do przetworzenia'"/>-->
  72. <!--<xsl:copy-of select="$xpath_value_tokens"></xsl:copy-of>-->
  73. <!--<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>-->
  74. <!--<xsl:if test="$debug &gt; 2"><xsl:message>#67.1 $input_obj_with_xpath: <xsl:copy-of select="$input_obj_with_xpath"/> </xsl:message></xsl:if>-->
  75. <!--<xsl:variable name="xpath_value_token">-->
  76. <xsl:call-template name="xpath_filter_apply">
  77. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  78. <xsl:with-param name="xpath" select="$xpath"/>
  79. <xsl:with-param name="xpath_value" select="$xpath_value"/>
  80. </xsl:call-template>
  81. <!--</xsl:variable>-->
  82. <!--<xsl:message>#73 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message>-->
  83. <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
  84. <!--<xsl:value-of select="$xpath_value_token"/>-->
  85. </xsl:when>
  86. <!--<xsl:when test="string-length($get_wfs_recurse_xsl:xpath_value) &gt;0">
  87. <xsl:if test="$debug &gt; 2"><xsl:message>#67.0 $xpath_value=(<xsl:value-of select="$get_wfs_recurse_xsl:xpath_value"/>); narzucone pewnie z wyzwolenia build.xml</xsl:message></xsl:if>
  88. <xsl:value-of select="$get_wfs_recurse_xsl:xpath_value"/>
  89. </xsl:when>
  90. <xsl:otherwise>
  91. <xsl:value-of select="$get_wfs_recurse_xsl:xpath_value"/><!-\- parametr z template narzuca wartosc -\->
  92. </xsl:otherwise>-->
  93. </xsl:choose>
  94. </xsl:variable>
  95. <xsl:copy-of select="$get_wfs_recurse_xsl:xpath_value_dita"/>
  96. </xsl:function>
  97. <xsl:template match="And" mode="simpleTypeMakeOgcFilter_merge_apply">
  98. <xsl:choose>
  99. <xsl:when test="child::node()">
  100. <xsl:value-of select="'&lt;ogc:And&gt;'"/>
  101. <xsl:apply-templates mode="simpleTypeMakeOgcFilter_merge_apply"/>
  102. <xsl:value-of select="'&lt;/ogc:And&gt;'"/>
  103. </xsl:when>
  104. </xsl:choose>
  105. </xsl:template>
  106. <xsl:template match="*" mode="simpleTypeMakeOgcFilter_merge_apply" xpath-default-namespace="http://www.opengis.net/ogc">
  107. <xsl:value-of select="concat('&lt;',name(),'&gt;')"/>
  108. <xsl:apply-templates mode="simpleTypeMakeOgcFilter_merge_apply"/>
  109. <xsl:value-of select="concat('&lt;/',name(),'&gt;')"/>
  110. </xsl:template>
  111. <xsl:template match="text()" mode="simpleTypeMakeOgcFilter_merge_apply">
  112. <xsl:value-of select="."/>
  113. </xsl:template>
  114. <xsl:template name="simpleTypeMakeOgcFilter_merge"><!-- do zrobienia polaczonego filtru OGC -->
  115. <xsl:param name="simpleTypeMakeOgcFilter" required="yes"/>
  116. <xsl:param name="xpath_dita" required="yes"/> <!-- @value -->
  117. <xsl:param name="xpath_value_dita" required="yes"/> <!-- @xpath_value -->
  118. <!-- <xsl:param name="get_wfs_recurse_xsl:xpath_dita" required="yes"/>
  119. <xsl:param name="get_wfs_recurse_xsl:xpath_value_dita" required="yes"/>-->
  120. <xsl:param name="RelatedFilter"/>
  121. <xsl:if test="$debug &gt; 2"><xsl:message>#1754 name="simpleTypeMakeOgcFilter_merge"
  122. $simpleTypeMakeOgcFilter = <xsl:copy-of select="$simpleTypeMakeOgcFilter"></xsl:copy-of>
  123. $get_wfs_recurse_xsl:xpath_dita = <xsl:copy-of select="$xpath_dita"/>
  124. $get_wfs_recurse_xsl:xpath_value_dita = <xsl:copy-of select="$xpath_value_dita"/>
  125. #EOF
  126. </xsl:message>
  127. </xsl:if>
  128. <xsl:value-of select="'&amp;Filter=&lt;ogc:Filter&gt;'"/>
  129. <xsl:variable name="Filter">
  130. <And>
  131. <xsl:for-each select="$RelatedFilter">
  132. <ogc:PropertyIsEqualTo>
  133. <ogc:PropertyName><xsl:value-of select="$xpath_dita"/></ogc:PropertyName>
  134. <ogc:Literal><xsl:value-of select="$xpath_value_dita"/></ogc:Literal>
  135. </ogc:PropertyIsEqualTo>
  136. </xsl:for-each>
  137. <ogc:PropertyIsEqualTo>
  138. <ogc:PropertyName><xsl:value-of select="$xpath_dita"/></ogc:PropertyName>
  139. <ogc:Literal><xsl:value-of select="$xpath_value_dita"/></ogc:Literal>
  140. </ogc:PropertyIsEqualTo>
  141. <And>
  142. <xsl:for-each select="$simpleTypeMakeOgcFilter/*">
  143. <xsl:copy-of select="."/>
  144. </xsl:for-each>
  145. </And>
  146. </And>
  147. </xsl:variable>
  148. <xsl:apply-templates select="$Filter" mode="simpleTypeMakeOgcFilter_merge_apply"/>
  149. <xsl:value-of select="'&lt;/ogc:Filter&gt;'"/>
  150. </xsl:template>
  151. <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 -->
  152. <xsl:param name="input_obj_with_xpath" required="yes"/>
  153. <xsl:param name="xpath" required="yes"/>
  154. <xsl:param name="xpath_value" required="yes"/>
  155. <xsl:variable name="xpath_value_token">
  156. <xsl:for-each select=" tokenize($xpath_value,'/')">
  157. <xsl:if test="$debug &gt; 2"><xsl:message>#341 znalazlem dla=<xsl:value-of select="."/>; ; <xsl:value-of select="$input_obj_with_xpath/node()[@xpath=current()]"/></xsl:message></xsl:if>
  158. <xsl:if test="$input_obj_with_xpath/node()[@xpath=current()]">
  159. <xsl:copy-of select="$input_obj_with_xpath/node()[@xpath=current()]"/>
  160. </xsl:if><!-- todo to jest bledne ale dziala tymczasowo-->
  161. </xsl:for-each>
  162. </xsl:variable>
  163. <xsl:if test="$debug &gt; 2"><xsl:message>#345 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message></xsl:if>
  164. <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
  165. <xsl:value-of select="$xpath_value_token"/>
  166. </xsl:template>
  167. <!--${simpleSchema_dir}/${namespace_prefix_p5_tr_map}/${main_build_recurse_ant.tr_map_sed}.xml-->
  168. <xsl:template name="main">
  169. <xsl:param name="typeName" select="$typeName"/>
  170. <xsl:param name="api" select="$api"/>
  171. <xsl:param name="protocol" select="$protocol"/>
  172. <xsl:param name="targetNamespace_DEFAULTS_prefix" select="$targetNamespace_DEFAULTS_prefix"/>
  173. <!--<xsl:param name="xpath_value" select="$xpath_value"/>-->
  174. <xsl:param name="get_wfs_recurse_xsl:xpath"/>
  175. <xsl:variable name="input_obj_with_xpath"><input_obj_with_xpath/></xsl:variable>
  176. <xsl:variable name="get_wfs_recurse_xsl:GetsimpleSchema" select="get_wfs_recurse_xsl:GetsimpleSchema($typeName)"/>
  177. <!--<xsl:copy-of select="$get_wfs_recurse_xsl:GetsimpleSchema"/>-->
  178. <xsl:variable name="get_wfs_recurse_xsl:typeNameRealResource" select="get_wfs_recurse_xsl:typeNameRealResource($get_wfs_recurse_xsl:GetsimpleSchema)"/>
  179. <xsl:variable name="xpath_dita" select="$xpath"/>
  180. <xsl:variable name="xpath_value_dita" select="$xpath_value"/>
  181. <xsl:variable name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter" select="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter($get_wfs_recurse_xsl:GetsimpleSchema)"/>
  182. <xsl:variable name="get_wfs_recurse_xsl:RelatedFilter" select="get_wfs_recurse_xsl:RelatedFilter($get_wfs_recurse_xsl:GetsimpleSchema)"/>
  183. <xsl:variable name="OGC_Filter">
  184. <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
  185. <xsl:with-param name="simpleTypeMakeOgcFilter" select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
  186. <xsl:with-param name="RelatedFilter" select="$get_wfs_recurse_xsl:RelatedFilter"/>
  187. <xsl:with-param name="xpath_dita" select="$xpath"/>
  188. <xsl:with-param name="xpath_value_dita" select="$xpath_value"/>
  189. <!--<xsl:with-param name="get_wfs_recurse_xsl:xpath_dita" select="$xpath"/>-->
  190. <!--<xsl:with-param name="get_wfs_recurse_xsl:xpath_value_dita" select="$xpath_value"/>-->
  191. </xsl:call-template>
  192. </xsl:variable>
  193. <xsl:if test="$debug &gt; 3">
  194. <xpath_dita>
  195. <xsl:value-of select="$xpath_dita"></xsl:value-of>
  196. </xpath_dita>
  197. <xpath_value_dita>
  198. <xsl:value-of select="$xpath_value_dita"></xsl:value-of>
  199. </xpath_value_dita>
  200. <!-- <get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
  201. <xsl:copy-of select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
  202. </get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
  203. <Filter>
  204. <xsl:copy-of select="$OGC_Filter"/>
  205. </Filter>-->
  206. </xsl:if>
  207. <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/> <!-- &amp;MAXFEATURES=15 -->
  208. <xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>
  209. <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($url_string)"/>
  210. <xsl:if test="$debug &gt; 5">
  211. <wfs_response>
  212. <request>Retrieving <xsl:value-of select="$url_string"/></request>
  213. <oryg>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;MAXFEATURES=15</oryg>
  214. <test>https://a.binder:@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:PROCES_INIT&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</test>
  215. <!--<xsl:copy-of select="$wfs_response"/>-->
  216. <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>
  217. </wfs_response>
  218. </xsl:if>
  219. <xsl:apply-templates mode="after_first_ant_assing_vars" select="$get_wfs_recurse_xsl:GetsimpleSchema">
  220. <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
  221. </xsl:apply-templates>
  222. </xsl:template>
  223. <!--<xsl:template match="RelatedFeature" mode="get_wfs_recurse_xsl:wfs_response">
  224. <xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>
  225. <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response">
  226. <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
  227. </xsl:apply-templates>
  228. </xsl:template>-->
  229. <!--<xsl:template match="simpleTypeMakeOgcFilter|RelatedFilter" mode="get_wfs_recurse_xsl:wfs_response"/>-->
  230. <!--<xsl:template match="*" mode="get_wfs_recurse_xsl:wfs_response">
  231. <xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>
  232. <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_simpleType" select="$get_wfs_recurse_xsl:wfs_response"/>
  233. <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeature">
  234. <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
  235. </xsl:apply-templates>
  236. </xsl:template>-->
  237. <xsl:template mode="get_wfs_recurse_xsl:wfs_response_RelatedFeature" match="RelatedFeature">
  238. <!--<xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>-->
  239. <xsl:param name="get_wfs_recurse_xsl:typeNameRealResource" select="@typeNameRealResource"/>
  240. <xsl:param name="input_obj_with_xpath" required="yes"/>
  241. <!--<xsl:param name="xpath" select="$xpath"/>-->
  242. <!--<xsl:param name="xpath_value" select="$xpath_value"/>-->
  243. <!--<xsl:variable name="input_obj_with_xpath">
  244. <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-\- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -\->
  245. </xsl:variable>-->
  246. <xsl:variable name="xpath_dita" select="get_wfs_recurse_xsl:xpath_dita('',@xpath)"/>
  247. <xsl:variable name="xpath_value_dita" select="get_wfs_recurse_xsl:xpath_value_dita(@xpath,@xpath_value,$input_obj_with_xpath)"/>
  248. <!--<xsl:variable name="get_wfs_recurse_xsl:GetsimpleSchema" select="get_wfs_recurse_xsl:GetsimpleSchema($typeName)"/>-->
  249. <xsl:variable name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
  250. <xsl:variable name="get_wfs_recurse_xsl:RelatedFilter" select="RelatedFilter"/>
  251. <xsl:variable name="OGC_Filter">
  252. <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
  253. <xsl:with-param name="simpleTypeMakeOgcFilter" select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
  254. <xsl:with-param name="RelatedFilter" select="$get_wfs_recurse_xsl:RelatedFilter"/>
  255. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  256. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  257. <!-- <xsl:with-param name="get_wfs_recurse_xsl:xpath_dita" select="$xpath_dita"/>
  258. <xsl:with-param name="get_wfs_recurse_xsl:xpath_value_dita" select="$xpath_value_dita"/>-->
  259. </xsl:call-template>
  260. </xsl:variable>
  261. <!--<input_obj_with_xpath><xsl:copy-of select="$input_obj_with_xpath"/></input_obj_with_xpath>-->
  262. <xsl:if test="$debug &gt; 4">
  263. <xpath_dita>
  264. <xsl:value-of select="$xpath_dita"/>/@xpath_value: <xsl:value-of select="@xpath_value"/>
  265. </xpath_dita>
  266. <xpath_value_dita>
  267. <xsl:value-of select="$xpath_value_dita"></xsl:value-of>
  268. </xpath_value_dita>
  269. <!-- <get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
  270. <xsl:copy-of select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
  271. </get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
  272. <Filter>
  273. <xsl:copy-of select="$OGC_Filter"/>
  274. </Filter>-->
  275. </xsl:if>
  276. <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/> <!-- &amp;MAXFEATURES=15 -->
  277. <xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>
  278. <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($url_string)"/>
  279. <xsl:if test="$debug &gt; 5">
  280. <wfs_response>
  281. <request>Retrieving <xsl:value-of select="$url_string"/></request>
  282. <oryg>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;MAXFEATURES=15</oryg>
  283. <test>https://a.binder:@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:PROCES_INIT&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</test>
  284. <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response//gml:featureMember[1]"/>
  285. </wfs_response>
  286. </xsl:if>
  287. <xsl:apply-templates mode="after_first_ant_assing_vars" select="." >
  288. <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
  289. </xsl:apply-templates>
  290. </xsl:template>
  291. <xsl:template mode="get_wfs_recurse_xsl:wfs_response_RelatedFeatureLoop" match="RelatedFeature">
  292. <!--<xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>-->
  293. <xsl:param name="get_wfs_recurse_xsl:typeNameRealResource" select="@typeNameRealResource"/>
  294. <xsl:param name="input_obj_with_xpath" required="yes"/>
  295. <xsl:param name="xpath" select="$xpath"/>
  296. <xsl:param name="xpath_value" select="$xpath_value"/>
  297. <!--<xsl:variable name="input_obj_with_xpath">
  298. <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-\- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -\->
  299. </xsl:variable>-->
  300. <xsl:variable name="xpath_dita" select="get_wfs_recurse_xsl:xpath_dita('',$xpath)"/>
  301. <xsl:variable name="xpath_value_dita" select="get_wfs_recurse_xsl:xpath_value_dita($xpath,$xpath_value,$input_obj_with_xpath)"/>
  302. <!--<xsl:variable name="get_wfs_recurse_xsl:GetsimpleSchema" select="get_wfs_recurse_xsl:GetsimpleSchema($typeName)"/>-->
  303. <xsl:variable name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
  304. <xsl:variable name="get_wfs_recurse_xsl:RelatedFilter" select="RelatedFilter"/>
  305. <xsl:variable name="OGC_Filter">
  306. <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
  307. <xsl:with-param name="simpleTypeMakeOgcFilter" select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
  308. <xsl:with-param name="RelatedFilter" select="$get_wfs_recurse_xsl:RelatedFilter"/>
  309. <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
  310. <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
  311. <!-- <xsl:with-param name="get_wfs_recurse_xsl:xpath_dita" select="$xpath_dita"/>
  312. <xsl:with-param name="get_wfs_recurse_xsl:xpath_value_dita" select="$xpath_value_dita"/>-->
  313. </xsl:call-template>
  314. </xsl:variable>
  315. <!--<input_obj_with_xpath><xsl:copy-of select="$input_obj_with_xpath"/></input_obj_with_xpath>-->
  316. <xsl:if test="$debug &gt; 4">
  317. <debug>
  318. <xsl:attribute name="typeNameRealResource" select="@typeNameRealResource"/>
  319. <xsl:attribute name="typeName" select="@typeName"/>
  320. <xpath_dita>
  321. <xsl:value-of select="$xpath_dita"/>/@xpath_value: <xsl:value-of select="@xpath_value"/>
  322. </xpath_dita>
  323. <xpath_value_dita>
  324. <xsl:value-of select="$xpath_value_dita"></xsl:value-of>
  325. </xpath_value_dita>
  326. </debug>
  327. </xsl:if>
  328. <!-- <get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
  329. <xsl:copy-of select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
  330. </get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
  331. <Filter>
  332. <xsl:copy-of select="$OGC_Filter"/>
  333. </Filter>-->
  334. <xsl:variable name="request_string" select="concat('?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&amp;SRSNAME=EPSG:3003')"/> <!-- &amp;MAXFEATURES=15 -->
  335. <xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>
  336. <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($url_string)"/>
  337. <xsl:if test="$debug &gt; 4">
  338. <wfs_response>
  339. <request>Retrieving <xsl:value-of select="$url_string"/></request>
  340. <oryg>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;MAXFEATURES=15</oryg>
  341. <test>https://a.binder:@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:PROCES_INIT&amp;SRSNAME=EPSG:3003&amp;MAXFEATURES=15</test>
  342. <!-- <debug_child_loop>-->
  343. <!--<xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>-->
  344. <!--</debug_child_loop>-->
  345. <!--<xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>-->
  346. </wfs_response>
  347. </xsl:if>
  348. <xsl:apply-templates mode="after_first_ant_assing_vars" select="." >
  349. <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
  350. </xsl:apply-templates>
  351. </xsl:template>
  352. <xsl:template mode="get_wfs_recurse_xsl:wfs_response_simpleType" match="*">
  353. <xsl:copy-of select="."/>
  354. </xsl:template>
  355. <xsl:template match="wfs:FeatureCollection">
  356. <xsl:apply-templates/>
  357. </xsl:template>
  358. <xsl:template match="gml:featureMember">
  359. <xsl:apply-templates mode="gml:featureMember"/>
  360. </xsl:template>
  361. <xsl:template match="*" mode="gml:featureMember">
  362. <!-- TODO parse from prefx requested type -->
  363. </xsl:template>
  364. <!-- xpath -->
  365. <xsl:template match="text()|comment()" mode="after_first_ant_assing_vars"/>
  366. <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
  367. <xsl:param name="loop_xpath" />
  368. <xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>
  369. <!--<RelatedFeatureRoot>-->
  370. <!-- first assign xpath to features from -->
  371. <xsl:variable name="wfs_output_nodes" select="$get_wfs_recurse_xsl:wfs_response"/>
  372. <xsl:variable name="current_RelatedFeature" select="*"/>
  373. <xsl:variable name="xml_id" select="@xml_id"/>
  374. <xsl:variable name="feature_pos_parent" select="@feature_pos"/>
  375. <xsl:if test="$debug &gt; 2"><xsl:message>
  376. {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} #354 count($wfs_output_nodes//gml:featureMember) <xsl:value-of select="count($wfs_output_nodes//gml:featureMember)"/></xsl:message></xsl:if>
  377. <!-- tutaj jest blad przetwarzania ze wrzuca po rekordzie do kolumny - trzeba przetworzyc dla kazdego feature member -->
  378. <xsl:for-each select="$wfs_output_nodes//gml:featureMember">
  379. <!--<wfs_record>
  380. <xsl:copy-of select="."/>
  381. </wfs_record>-->
  382. <xsl:variable name="input_obj_with_xpath">
  383. <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -->
  384. </xsl:variable>
  385. <xsl:variable name="input_obj_fid" select="*"/> <!-- dla wykrycia @fid -->
  386. <xsl:apply-templates mode="after_first_ant_assing_vars_childs" select="$current_RelatedFeature">
  387. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  388. <xsl:with-param name="xml_id_parent" select="$xml_id"/>
  389. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  390. <xsl:with-param name="feature_pos" select="position()"/><!-- wiecej features z relacji dokladamy pozycje -->
  391. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/> <!-- @2017-04 byly nadpisywane informacje - trzeba dorzucic jeszcze $feature_pos_parent w nazwie przetwarzania -->
  392. <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
  393. </xsl:apply-templates>
  394. <!-- cache tasks ? -->
  395. </xsl:for-each>
  396. <!--</RelatedFeatureRoot>-->
  397. </xsl:template>
  398. <!--<xsl:template match="wfs:FeatureCollection|gml:featureMember" mode="after_first_ant_assing_xpath">
  399. <xsl:apply-templates mode="after_first_ant_assing_xpath"/>
  400. </xsl:template>-->
  401. <xsl:template mode="after_first_ant_assing_xpath" match="*">
  402. <xsl:param name="curr_xpath"/>
  403. <xsl:param name="loop_xpath"/>
  404. <xsl:choose>
  405. <xsl:when test="name()=$typeName">
  406. <xsl:apply-templates mode="after_first_ant_assing_xpath">
  407. <xsl:with-param name="curr_xpath" select="$curr_xpath"/>
  408. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  409. </xsl:apply-templates>
  410. </xsl:when>
  411. <xsl:otherwise>
  412. <xsl:variable name="curr_xpath_tmpl">
  413. <xsl:choose>
  414. <xsl:when test="$curr_xpath=''">
  415. <xsl:value-of select="local-name()"/> <!-- bylo local-name() - trzeba dorzucic xpath przechodzacy aby budowal sie w kwestii -->
  416. </xsl:when>
  417. <xsl:otherwise>
  418. <xsl:value-of select="concat($curr_xpath,'/',local-name())"/>
  419. </xsl:otherwise>
  420. </xsl:choose>
  421. </xsl:variable>
  422. <!--<xsl:variable name="curr_xpath_tmpl" select="'asdf'"/>-->
  423. <xsl:element name="{name()}">
  424. <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
  425. <xsl:for-each select="@*">
  426. <xsl:choose>
  427. <xsl:when test="name()='fid'"/>
  428. <xsl:otherwise><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:otherwise>
  429. </xsl:choose>
  430. </xsl:for-each>
  431. <xsl:value-of select="text()"/>
  432. <xsl:apply-templates mode="after_first_ant_assing_xpath">
  433. <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
  434. </xsl:apply-templates>
  435. </xsl:element>
  436. </xsl:otherwise>
  437. </xsl:choose>
  438. </xsl:template>
  439. <xsl:template match="text()" mode="after_first_ant_assing_xpath"/>
  440. <xsl:template match="simpleTypeMakeOgcFilter" mode="after_first_ant_assing_vars_childs">
  441. <xsl:if test="$debug &gt; 2"><xsl:message>#621 bypassing simpleTypeMakeOgcFilter in after_first_ant_assing_vars_childs</xsl:message></xsl:if>
  442. </xsl:template>
  443. <!-- przetwarzanie kolejne w celu podstawienia wartosci i wystawienia build dla kolejnych wezlow - problem z obsluga rownorzednie zagniezdzonych wezlow poprzez inne wezly -->
  444. <xsl:template match="*" mode="after_first_ant_assing_vars_childs">
  445. <xsl:param name="xml_id_parent" required="yes"/>
  446. <xsl:param name="loop_xpath" required="yes"/>
  447. <xsl:param name="input_obj_with_xpath" required="yes"/>
  448. <xsl:param name="feature_pos" required="yes"/>
  449. <xsl:param name="feature_pos_parent" required="yes"/>
  450. <xsl:param name="input_obj_fid" required="no"/>
  451. <xsl:for-each select=".">
  452. <xsl:choose>
  453. <xsl:when test="1=2"/>
  454. <xsl:otherwise>
  455. <xsl:element name="{local-name()}">
  456. <!--<xsl:if test="$input_obj_fid">
  457. <!-\-<xsl:attribute name="input_obj_fid_name" select="$input_obj_fid/name()"/>-\->
  458. <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>
  459. </xsl:if>-->
  460. <!--<xsl:copy-of select="namespace::node()"/>-->
  461. <xsl:for-each select="@*">
  462. <xsl:choose>
  463. <xsl:when test="name()='fid'"/>
  464. <xsl:when test="name()='xml_id'"/>
  465. <xsl:when test="name()='xpath'">
  466. <!--<xsl:attribute name="xpath_parsed" select="."/>-->
  467. <!--1:<xsl:value-of select="$parent_obj//node()[@system_cache__appinfo:xpath=$xpath]/text()"/>-->
  468. <!--<xsl:value-of select="$parent_obj//node()[local-name()=$xpath]/text()"/>-->
  469. <!--V:<xsl:value-of select="$xpath"/>-->
  470. </xsl:when>
  471. <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
  472. </xsl:choose>
  473. </xsl:for-each>
  474. <xsl:choose>
  475. <xsl:when test="@xpath">
  476. <!--<xsl:variable name="enter_to_ph">-->
  477. <xsl:choose>
  478. <!--<xsl:when test="@xpath_token_filter and @xpath_token ">
  479. <!-\- implementacja filtra dla czegos oddzielonego parametrem -\->
  480. <xsl:variable name="xpath_token_filter" select="tokenize($input_obj_with_xpath/node()[local-name()=current()/@xpath],@xpath_token_filter)"/>
  481. <xsl:for-each select=" tokenize(@xpath_token,' ')">
  482. <xsl:variable name="xpath_token" select="number(.)"/>
  483. <xsl:copy-of select="$xpath_token_filter[$xpath_token]"></xsl:copy-of>
  484. </xsl:for-each>
  485. </xsl:when>-->
  486. <xsl:when test="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/*">
  487. <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/*"/>
  488. </xsl:when>
  489. <xsl:otherwise>
  490. <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
  491. </xsl:otherwise>
  492. </xsl:choose>
  493. <!--</xsl:variable>-->
  494. <!--<xsl:copy-of select="$enter_to_ph"/>-->
  495. </xsl:when>
  496. </xsl:choose>
  497. <!--<xsl:comment>#1938 value of text()</xsl:comment>-->
  498. <!--XXXX <xsl:value-of select="text()"/>-->
  499. <xsl:apply-templates mode="after_first_ant_assing_vars_childs">
  500. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  501. <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
  502. <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
  503. <xsl:with-param name="feature_pos" select="$feature_pos"/>
  504. <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
  505. <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
  506. </xsl:apply-templates>
  507. </xsl:element>
  508. </xsl:otherwise>
  509. </xsl:choose>
  510. </xsl:for-each>
  511. </xsl:template>
  512. <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars_childs">
  513. <xsl:if test="$debug &gt; 2"><xsl:message>#1638 ignored @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; @typeName=<xsl:value-of select="@typeName"/>; @xml_id=<xsl:value-of select="@xml_id"/>; </xsl:message></xsl:if>
  514. </xsl:template> <!-- to disable ignored maxOccurs=0 -->
  515. <xsl:template match="RelatedFeature[not(@system_cache__appinfo:maxOccurs='0') or not($ignore_maxOccurs_0)]" mode="after_first_ant_assing_vars_childs">
  516. <xsl:param name="input_obj_with_xpath" required="yes"/>
  517. <xsl:param name="xml_id_parent" required="yes"/>
  518. <xsl:param name="loop_xpath" />
  519. <xsl:param name="feature_pos" required="yes"/>
  520. <xsl:param name="feature_pos_parent" required="yes"/>
  521. <xsl:param name="input_obj_fid" required="yes"/>
  522. <xsl:param name="xpath_query"/> <!-- + added test -->
  523. <xsl:if test="$debug &gt; 2"><xsl:message>#411 $feature_pos=<xsl:value-of select="$feature_pos"/>; mode after_first_ant_assing_vars_childs bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message></xsl:if>
  524. <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
  525. <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
  526. <xsl:variable name="xml_id" select="@xml_id"/>
  527. <xsl:variable name="loop_xpath" select="concat($loop_xpath,'/',$xml_id,'.',$feature_pos)"/> <!-- loop path too long ,'.',$featureID_name -->
  528. <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
  529. <!--<debug_358_RelatedFeature>
  530. <xsl:copy-of select="$input_obj_with_xpath"/>
  531. </debug_358_RelatedFeature>-->
  532. <!--<xsl:variable name="feature_pos">
  533. <xsl:choose>
  534. <xsl:when test="$feature_pos=1"/>
  535. <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
  536. </xsl:choose>
  537. </xsl:variable>-->
  538. <xsl:variable name="test_xpath_query">
  539. <xsl:call-template name="test_xpath_query">
  540. <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
  541. <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
  542. <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
  543. <xsl:with-param name="xpath_query" select="$xpath_query"/>
  544. </xsl:call-template>
  545. </xsl:variable>
  546. <xsl:choose>
  547. <xsl:when test="$test_xpath_query='1'">
  548. <xsl:if test="$debug &gt; 2"><xsl:message>[][][][][]\/\/\/\/\/\/\/\/\/\/\/ #1540 jest okazja do zrobienia bilda $feature_pos_parent = <xsl:value-of select="$feature_pos_parent"/> ; $feature_pos=<xsl:value-of select="$feature_pos"/> $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>; match=RelatedFeature mode=after_first_ant_assing_vars_childs </xsl:message></xsl:if>
  549. <xsl:comment>#527 there we exec child dig</xsl:comment>
  550. <!-- <xsl:element name="RelatedFeature">
  551. <xsl:copy-of select="@*"/>
  552. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  553. <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
  554. <xsl:attribute name="feature_pos" select="$feature_pos"/>
  555. <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/>
  556. <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>-->
  557. <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeature" select=".">
  558. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  559. </xsl:apply-templates>
  560. <!--</xsl:element>-->
  561. </xsl:when>
  562. <xsl:otherwise>
  563. <xsl:if test="$debug &gt; 2"><xsl:message terminate="no">#389b
  564. #
  565. #
  566. #
  567. 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
  568. #
  569. #</xsl:message></xsl:if>
  570. </xsl:otherwise>
  571. </xsl:choose>
  572. </xsl:template>
  573. <xsl:template match="RelatedFeatureLoop" mode="after_first_ant_assing_vars_childs">
  574. <xsl:if test="$debug &gt; 2"><xsl:message>#1718 ignored @maxOccurs=<xsl:value-of select="@system_cache__appinfo:maxOccurs"/>; @typeName=<xsl:value-of select="@typeName"/>; @xml_id=<xsl:value-of select="@xml_id"/>; </xsl:message></xsl:if>
  575. </xsl:template>
  576. <xsl:template match="RelatedFeatureLoop[not(@system_cache__appinfo:maxOccurs='0') or not($ignore_maxOccurs_0)]" mode="after_first_ant_assing_vars_childs">
  577. <xsl:param name="input_obj_with_xpath" required="yes"/>
  578. <xsl:param name="xml_id_parent" required="yes"/>
  579. <xsl:param name="loop_xpath" />
  580. <xsl:param name="feature_pos" required="yes"/>
  581. <xsl:param name="feature_pos_parent" required="yes"/>
  582. <xsl:param name="input_obj_fid" required="yes"/>
  583. <xsl:param name="xpath_query"/> <!-- + added test -->
  584. <xsl:if test="$debug &gt; 2"><xsl:message>#411 $feature_pos=<xsl:value-of select="$feature_pos"/>; mode after_first_ant_assing_vars_childs bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message></xsl:if>
  585. <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
  586. <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
  587. <xsl:variable name="xml_id" select="@xml_id"/>
  588. <xsl:variable name="loop_xpath" select="concat($loop_xpath,'/',$xml_id,'.',$feature_pos)"/> <!-- loop path too long ,'.',$featureID_name -->
  589. <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
  590. <!--<debug_358_RelatedFeature>
  591. <xsl:copy-of select="$input_obj_with_xpath"/>
  592. </debug_358_RelatedFeature>-->
  593. <!--<xsl:variable name="feature_pos">
  594. <xsl:choose>
  595. <xsl:when test="$feature_pos=1"/>
  596. <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
  597. </xsl:choose>
  598. </xsl:variable>-->
  599. <xsl:variable name="test_xpath_query">
  600. <xsl:call-template name="test_xpath_query">
  601. <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
  602. <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
  603. <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
  604. <xsl:with-param name="xpath_query" select="$xpath_query"/>
  605. </xsl:call-template>
  606. </xsl:variable>
  607. <xsl:choose>
  608. <xsl:when test="$test_xpath_query='1'">
  609. <xsl:if test="$debug &gt; 2"><xsl:message>[][][][][]\/\/\/\/\/\/\/\/\/\/\/ #1540 jest okazja do zrobienia bilda $feature_pos_parent = <xsl:value-of select="$feature_pos_parent"/> ; $feature_pos=<xsl:value-of select="$feature_pos"/> $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>; match=RelatedFeature mode=after_first_ant_assing_vars_childs </xsl:message></xsl:if>
  610. <xsl:comment>#527 there we exec child dig</xsl:comment>
  611. <!-- <xsl:element name="RelatedFeature">
  612. <xsl:copy-of select="@*"/>
  613. <xsl:attribute name="featureID_name" select="$featureID_name"/>
  614. <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
  615. <xsl:attribute name="feature_pos" select="$feature_pos"/>
  616. <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/>
  617. <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>-->
  618. <xsl:comment>#710 opening new Loop recurse instance for <xsl:value-of select="@typeName"/></xsl:comment>
  619. <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeatureLoop" select="get_wfs_recurse_xsl:GetsimpleSchema(@typeName)">
  620. <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
  621. <xsl:with-param name="xpath" select="@xpath"/>
  622. <xsl:with-param name="xpath_value" select="@xpath_value"/>
  623. </xsl:apply-templates>
  624. <!--</xsl:element>-->
  625. </xsl:when>
  626. <xsl:otherwise>
  627. <xsl:if test="$debug &gt; 2"><xsl:message terminate="yes">#389b
  628. #
  629. #
  630. #
  631. 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
  632. #
  633. #</xsl:message></xsl:if>
  634. </xsl:otherwise>
  635. </xsl:choose>
  636. </xsl:template>
  637. <xsl:template match="text()" mode="after_first_ant_assing_vars_childs"/>
  638. <xsl:template match="comment()" mode="after_first_ant_assing_vars_childs"/>
  639. <!-- pozbieranie do kupy wszystkich xmli i zlozenie dity -->
  640. <xsl:template name="test_xpath_query">
  641. <!-- to verify if retrieve some node based on user requested tree limit filter -->
  642. <xsl:param name="ignore_maxOccurs_0" required="yes"/>
  643. <xsl:param name="xpath_query" required="yes"/>
  644. <xsl:param name="featureID_name_dita" required="yes"/>
  645. <xsl:param name="system_cache__appinfo:maxOccurs" required="yes"/>
  646. <xsl:if test="$debug &gt; 2"><xsl:message>#1290 $system_cache__appinfo:maxOccurs=<xsl:value-of select="$system_cache__appinfo:maxOccurs"/>; $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; $xpath_query=<xsl:value-of select="$xpath_query"/>; </xsl:message></xsl:if>
  647. <xsl:if test="$ignore_maxOccurs_0"><xsl:if test="$debug &gt; 2"><xsl:message terminate="no">#1344 test igrnore is true()=<xsl:value-of select="$ignore_maxOccurs_0"/>;</xsl:message></xsl:if></xsl:if>
  648. <xsl:variable name="TestMaxOccurs">
  649. <xsl:choose>
  650. <xsl:when test="$system_cache__appinfo:maxOccurs='0' and $ignore_maxOccurs_0"></xsl:when>
  651. <xsl:otherwise>1</xsl:otherwise>
  652. </xsl:choose>
  653. </xsl:variable>
  654. <xsl:value-of select="$TestMaxOccurs"/>
  655. </xsl:template>
  656. </xsl:stylesheet>