get_wfs_recurse_xsl.xsl 50 KB

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