| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:wfs="http://www.opengis.net/wfs"
- xmlns:gml="http://www.opengis.net/gml"
- xmlns:ogc="http://www.opengis.net/ogc"
- xmlns:p5="https://biuro.biall-net.pl/wfs"
- 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"
- xmlns:get_wfs_recurse_xsl="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/get_wfs_recurse_xsl.xsd"
- xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
- xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
- xmlns:default_objects="https://biuro.biall-net.pl/wfs/default_objects"
- xmlns:xlink="http://www.w3.org/1999/xlink"
-
- xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
- xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"
- xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY"
- xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI"
- exclude-result-prefixes="xs"
- version="2.0">
-
- <!-- TESTING for recurse get WFS using xsd schemas and/or retrieved xlinks -->
-
- <xsl:import href="system_cache__appinfo/escape_functions.xsl"/>
-
- <xsl:include href="default_db/enter_to_ph.xsl"/>
-
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
-
-
-
- <xsl:param name="typeName" /> <!-- select="'p5_default_db:PROCES_INIT'" -->
- <xsl:param name="typeName.object"/> <!-- select="'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA'" -->
- <xsl:param name="xpath" select="'ID'"/>
- <xsl:param name="xpath_value" select="'994'"/>
- <xsl:param name="uuid" select="'PROCES_INIT_PID_994_ALL_test'"/>
- <xsl:param name="MAXFEATURES" select="1000"/>
-
- <!--<xsl:param name="procesy5_system_schema_file" required="yes"/>-->
- <!--<xsl:param name="vrtfNamespaces_file" required="yes"/>-->
-
- <xsl:param name="username" select="'a.binder'"/>
- <xsl:param name="username.pass" required="yes"/>
- <xsl:param name="php_session_id_ok.string"/>
- <xsl:param name="simpleSchema_dir" required="yes"/>
- <xsl:param name="simpleSchema.xml" /> <!-- Optionally force simpleSchema to build map -->
-
- <xsl:param name="targetNamespace_DEFAULTS_prefix" select="'default_db'"/> <!-- TODO should be detected -->
- <xsl:param name="debug" select="0"/>
-
-
- <xsl:param name="api" select="'biuro.biall-net.pl/SE/version-git/wfs-data.php'"/>
- <xsl:param name="protocol" select="'https://'"/>
-
- <!--<xsl:variable name="vrtfNamespaces" select="doc($vrtfNamespaces_file)"/>
- <xsl:variable name="procesy5_system_schema" select="doc($procesy5_system_schema_file)"/>
- -->
-
- <xsl:param name="ignore_maxOccurs_0" select="'1'"/>
-
- <xsl:param name="api_recurse"/> <!-- to use api resolveDepth -->
- <xsl:param name="resolveDepth" select="5"/>
- <xsl:param name="p5:links.recurse_level.limit" select="8"/>
- <xsl:param name="p5:links.next.recurse_level.limit" select="10"/>
- <xsl:param name="p5:links.loop.context.nodes.min.distance" select="4"/> <!-- when detected in @xlink or @next <get_wfs_recurse_xsl:context.nodes//@fid , we calculate when it is to be treated as loop, if above $p5:links.recurse_level.limit - to be optimized -->
- <xsl:param name="noRelatedFeatureRoot"/>
-
- <!-- Plik XML z query XML <GetFeature xmlns="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="2.0.2"><wfs:Query>
- <wfs:PropertyName>ID</wfs:PropertyName>
- <wfs:PropertyName>PARENT_ID</wfs:PropertyName>
- <wfs:PropertyName>TYPE</wfs:PropertyName>
- <wfs:PropertyName>DESC</wfs:PropertyName>
- <wfs:PropertyName resolve="all" resolveDepth="2">default_db__x3A__CRM_LISTA_ZASOBOW:CRM_LISTA_ZASOBOW</wfs:PropertyName>
- <ogc:Filter>
- <ogc:Or>
- <ogc:PropertyIsEqualTo>
- <ogc:PropertyName>ID</ogc:PropertyName>
- <ogc:Literal>1003</ogc:Literal>
- </ogc:PropertyIsEqualTo>
- <ogc:PropertyIsEqualTo>
- <ogc:PropertyName>ID</ogc:PropertyName>
- <ogc:Literal>608</ogc:Literal>
- </ogc:PropertyIsEqualTo>
- </ogc:Or>
- </ogc:Filter>
- </wfs:Query></GetFeature>
- -->
-
-
- <xsl:function name="get_wfs_recurse_xsl:GetsimpleSchema">
- <xsl:param name="typeNameRealResource"/>
-
- <xsl:variable name="featureID_name_dita">
- <xsl:choose>
- <xsl:when test=" substring-before(system_cache__appinfo:translate_object_escaped_prefix_from_string(substring-before($typeNameRealResource,':')),':')">
- <xsl:value-of select="$typeNameRealResource"/>
- </xsl:when>
- <xsl:when test=" substring-after($typeNameRealResource,':')">
- <xsl:value-of select="substring-after($typeNameRealResource,':')"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="$typeNameRealResource"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="simpleSchemaFile">
- <xsl:choose>
- <xsl:when test=" substring-before(system_cache__appinfo:translate_object_escaped_prefix_from_string(substring-before($typeNameRealResource,':')),':')">
- <xsl:message>#74 this is object not simpleType element - selecting simpleSchema to <xsl:value-of select="concat($simpleSchema_dir,'/',substring-before(system_cache__appinfo:translate_object_escaped_prefix_from_string(substring-before($typeNameRealResource,':')),':'),'/',substring-after($typeNameRealResource,':'),'.xml')"/></xsl:message>
- <xsl:value-of select="concat($simpleSchema_dir,'/',substring-before(system_cache__appinfo:translate_object_escaped_prefix_from_string(substring-before($typeNameRealResource,':')),':'),'/',substring-after($typeNameRealResource,':'),'.xml')"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="concat($simpleSchema_dir,'/',$targetNamespace_DEFAULTS_prefix,'/',$featureID_name_dita,'.xml')"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:message>#57 get_wfs_recurse_xsl:GetsimpleSchema: from $typeNameRealResource=<xsl:value-of select="$typeNameRealResource"/>; <xsl:value-of select="$simpleSchemaFile"/> for featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>;</xsl:message>
-
-
- <xsl:if test="not( substring-before(system_cache__appinfo:translate_object_escaped_prefix_from_string(substring-before($typeNameRealResource,':')),':'))">
- <xsl:copy-of select="doc($simpleSchemaFile)"/>
- </xsl:if>
-
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:typeNameRealResource">
- <xsl:param name="get_wfs_recurse_xsl:GetsimpleSchema"/>
- <xsl:choose>
- <xsl:when test="$api_recurse">
- <!-- default_db:CRM_LISTA_ZASOBOW -->
- <xsl:choose>
- <xsl:when test="string-length($typeName.object) > 0">
- <xsl:message>#128-A set $typeName.object = <xsl:value-of select="$typeName.object"/></xsl:message>
- <xsl:value-of select="$typeName.object"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#128-A set $typeName.local = <xsl:value-of select="$get_wfs_recurse_xsl:GetsimpleSchema/RelatedFeature/@typeName"/></xsl:message>
- <xsl:variable name="typeName.local" select="$get_wfs_recurse_xsl:GetsimpleSchema/RelatedFeature/@typeName"/>
- <xsl:value-of select="concat( system_cache__appinfo:escape_object_prefix_to_string($typeName),':', system_cache__appinfo:clean_object_prefix($typeName))"/>
- <xsl:message>#128-A-2 set result get_wfs_recurse_xsl:typeNameRealResource = <xsl:value-of select="concat( system_cache__appinfo:escape_object_prefix_to_string($typeName),':', system_cache__appinfo:clean_object_prefix($typeName))"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:GetsimpleSchema/(RelatedFeature|RelatedFeatureRoot)/@typeNameRealResource">
- <xsl:value-of select="$get_wfs_recurse_xsl:GetsimpleSchema/(RelatedFeature|RelatedFeatureRoot)/@typeNameRealResource"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">#145 SET $get_wfs_recurse_xsl:GetsimpleSchema/RelatedFeature/@typeNameRealResource param!
- in file <xsl:value-of select="$simpleSchema.xml"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:GetsimpleSchema"/>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:function>
- <xsl:function name="get_wfs_recurse_xsl:RelatedFilter">
- <xsl:param name="get_wfs_recurse_xsl:GetsimpleSchema"/>
- <xsl:value-of select="$get_wfs_recurse_xsl:GetsimpleSchema/(RelatedFeatureRoot|RelatedFeature)/RelatedFilter"/>
- </xsl:function>
-
- <xsl:template name="get_wfs_recurse_xsl:request_string">
- <xsl:param name="protocol" select="$protocol"/>
- <xsl:param name="api" select="$api"/>
- <xsl:param name="targetNamespace_DEFAULTS_prefix" select="$targetNamespace_DEFAULTS_prefix"/>
- <xsl:param name="username" select="$username"/>
- <xsl:param name="username.pass" select="$username.pass"/>
- <xsl:param name="REQUEST.SERVICE" select="'WFS'"/>
- <xsl:param name="REQUEST.VERSION" select="'1.0.0'"/>
- <xsl:param name="REQUEST.TYPE" select="'GetFeature'"/>
- <xsl:param name="REQUEST.MAXFEATURES" />
- <xsl:param name="REQUEST.TYPENAME" required="yes"/>
- <xsl:param name="OGC_Filter"/>
- <xsl:param name="REQUEST.SRSNAME" select="'EPSG:3003'"/>
- <xsl:variable name="php_session_id_ok.string">
- <xsl:if test=" string-length($php_session_id_ok.string) > 0">
- <xsl:value-of select="concat('&sid=',normalize-space($php_session_id_ok.string))"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="api_recurse.request">
- <xsl:choose>
- <xsl:when test="$api_recurse">
- <xsl:value-of select="concat('&resolveDepth=',$resolveDepth,'&resolve=all')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="username_and_pass">
- <xsl:choose>
- <xsl:when test="string-length($php_session_id_ok.string) > 0"/>
- <xsl:otherwise><xsl:value-of select="concat($username,':',$username.pass,'@')"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="REQUEST.MAXFEATURES">
- <xsl:choose>
- <xsl:when test=" string-length($REQUEST.MAXFEATURES) > 0">
- <xsl:value-of select="concat('&MAXFEATURES=',$REQUEST.MAXFEATURES)"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="number($debug) > 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>
- <xsl:value-of select="concat($protocol,$username_and_pass,$api,'/',$targetNamespace_DEFAULTS_prefix,'/?SERVICE=',$REQUEST.SERVICE,'&VERSION=',$REQUEST.VERSION,'&REQUEST=',$REQUEST.TYPE,'&TYPENAME=',$REQUEST.TYPENAME,$php_session_id_ok.string,$api_recurse.request,$OGC_Filter,'&SRSNAME=',$REQUEST.SRSNAME)"/>
- </xsl:template>
-
-
-
-
- <xsl:template match="*" mode="get_wfs_recurse_xsl:context.nodes">
- <xsl:for-each select=".//*[@fid]">
- <get_wfs_recurse_xsl:nodes fid="{@fid}" root.distance="{count( ancestor::node())}"/>
- </xsl:for-each>
- </xsl:template>
-
-
- <xsl:function name="get_wfs_recurse_xsl:context.PRIMARYKEY.merge">
- <xsl:param name="get_wfs_recurse_xsl:PRIMARYKEY.nodes"/>
- <xsl:param name="p5:fid"/>
- <xsl:choose>
- <xsl:when test=" string-length($p5:fid) >0">
- <get_wfs_recurse_xsl:context.nodes>
- <xsl:copy-of select="$get_wfs_recurse_xsl:PRIMARYKEY.nodes/get_wfs_recurse_xsl:PRIMARYKEY.nodes/*"/>
- <get_wfs_recurse_xsl:nodes fid="{$p5:fid}"/>
- </get_wfs_recurse_xsl:context.nodes>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$get_wfs_recurse_xsl:PRIMARYKEY.nodes"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
-
- <xsl:function name="get_wfs_recurse_xsl:context.nodes.merge">
- <xsl:param name="get_wfs_recurse_xsl:context.nodes"/>
- <xsl:param name="current.node"/>
- <get_wfs_recurse_xsl:context.nodes>
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.nodes/get_wfs_recurse_xsl:context.nodes/*"/>
- <xsl:for-each select="$current.node//*[@fid]">
- <get_wfs_recurse_xsl:nodes fid="{@fid}" root.distance="{count( ancestor::node())}" added="by_merge"/>
- </xsl:for-each>
- </get_wfs_recurse_xsl:context.nodes>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter">
- <xsl:param name="get_wfs_recurse_xsl:GetsimpleSchema"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:GetsimpleSchema/RelatedFeature/simpleTypeMakeOgcFilter"/>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:xpath_dita">
- <xsl:param name="xpath"/>
- <xsl:param name="get_wfs_recurse_xsl:xpath"/>
- <xsl:choose>
- <xsl:when test=" string-length($get_wfs_recurse_xsl:xpath) >0">
- <xsl:value-of select="$get_wfs_recurse_xsl:xpath"/>
- <xsl:if test="$debug > 2"><xsl:message>#121 narzucam $xpath=(<xsl:value-of select="$get_wfs_recurse_xsl:xpath"/>) z wyzwolenia build.xml </xsl:message></xsl:if>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="$xpath"/></xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:xpath_value_dita">
- <xsl:param name="xpath"/>
- <xsl:param name="xpath_value"/>
- <!--<xsl:param name="get_wfs_recurse_xsl:xpath_value"/>-->
- <xsl:param name="input_obj_with_xpath"/>
-
- <xsl:variable name="get_wfs_recurse_xsl:xpath_value_dita">
- <xsl:choose>
- <xsl:when test="$xpath_value">
- <!--<xsl:variable name="xpath_value_tokens" select="tokenize(@xpath_value,'/')"/>-->
- <!--<xsl:value-of select="'todo zapytanie xpath do przetworzenia'"/>-->
- <!--<xsl:copy-of select="$xpath_value_tokens"></xsl:copy-of>-->
- <!--<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>-->
- <!--<xsl:if test="$debug > 2"><xsl:message>#67.1 $input_obj_with_xpath: <xsl:copy-of select="$input_obj_with_xpath"/> </xsl:message></xsl:if>-->
- <!--<xsl:variable name="xpath_value_token">-->
- <xsl:call-template name="xpath_filter_apply">
- <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
- <xsl:with-param name="xpath" select="$xpath"/>
- <xsl:with-param name="xpath_value" select="$xpath_value"/>
- </xsl:call-template>
- <!--</xsl:variable>-->
- <!--<xsl:message>#73 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message>-->
- <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
- <!--<xsl:value-of select="$xpath_value_token"/>-->
- </xsl:when>
- <!--<xsl:when test="string-length($get_wfs_recurse_xsl:xpath_value) >0">
- <xsl:if test="$debug > 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>
- <xsl:value-of select="$get_wfs_recurse_xsl:xpath_value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$get_wfs_recurse_xsl:xpath_value"/><!-\- parametr z template narzuca wartosc -\->
- </xsl:otherwise>-->
- </xsl:choose>
- </xsl:variable>
- <xsl:copy-of select="$get_wfs_recurse_xsl:xpath_value_dita"/>
- </xsl:function>
-
- <xsl:template match="And" mode="simpleTypeMakeOgcFilter_merge_apply">
- <xsl:choose>
- <xsl:when test="child::node()">
- <xsl:value-of select="'<ogc:And>'"/>
- <xsl:apply-templates mode="simpleTypeMakeOgcFilter_merge_apply"/>
- <xsl:value-of select="'</ogc:And>'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="*" mode="simpleTypeMakeOgcFilter_merge_apply" xpath-default-namespace="http://www.opengis.net/ogc">
- <xsl:value-of select="concat('<',name(),'>')"/>
- <xsl:apply-templates mode="simpleTypeMakeOgcFilter_merge_apply"/>
- <xsl:value-of select="concat('</',name(),'>')"/>
- </xsl:template>
-
- <xsl:template match="text()" mode="simpleTypeMakeOgcFilter_merge_apply">
- <xsl:value-of select="."/>
- </xsl:template>
-
- <xsl:function name="p5:get_get_from_url">
- <xsl:param name="p5:url"/> <!-- https://biuro.biall-net.pl/SE/version-git/wfs-data.php?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=d -->
- <xsl:param name="get"/><!-- which param from get - maybe REQUEST -->
- <xsl:choose>
- <xsl:when test="contains($p5:url,'?')">
- <xsl:variable name="result">
- <xsl:for-each select="tokenize( substring-after($p5:url,'?'),'&')">
- <xsl:if test="substring-before(.,'=') = $get"><xsl:value-of select="substring-after(.,'=')"/></xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($result) > 0">
- <xsl:value-of select="$result"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">#263 p5:get_get_from_url - cannot get get value=<xsl:value-of select="$get"/> from url string = <xsl:value-of select="$p5:url"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">#268 p5:get_get_from_url url=<xsl:value-of select="$p5:url"/> dont seems correct to extract get</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:function>
-
- <xsl:template match="@next" mode="p5:fid">
- <!-- https://biuro.biall-net.pl/SE/version-git/wfs-data.php?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=default_db__x3A__BI_audit_MSIG_name%3ABI_audit_MSIG_name&sid=p3s8biqkc8jd4q0ihbqqhr8ueeub7hka9g8nagh3haiqrep37fr6hngspi0m3155v4gl0g2te86dd2hosir0f6l83t7t0j8fsoqq3k2&resolveDepth=4&resolve=all&PRIMARYKEY=7666&SRSNAME=EPSG%3A3003&startIndex=50000&maxFeatures20 -->
- <xsl:variable name="TYPENAME" select="p5:get_get_from_url(.,'TYPENAME')"/>
- <xsl:variable name="PRIMARYKEY" select="p5:get_get_from_url(.,'PRIMARYKEY')"/>
- <xsl:variable name="TYPENAME">
- <xsl:choose>
- <xsl:when test="substring-after($TYPENAME,':')">
- <xsl:value-of select="substring-after($TYPENAME,':')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$TYPENAME"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat($TYPENAME,'.',$PRIMARYKEY)"/>
- </xsl:template>
-
- <xsl:function name="p5:fid">
- <xsl:param name="p5:next"/>
- <xsl:choose>
- <xsl:when test="contains($p5:next,'PRIMARYKEY=')">
- <xsl:variable name="TYPENAME" select="p5:get_get_from_url($p5:next,'TYPENAME')"/>
- <xsl:variable name="PRIMARYKEY" select="p5:get_get_from_url($p5:next,'PRIMARYKEY')"/>
- <xsl:value-of select="concat($TYPENAME,'.',$PRIMARYKEY)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#312 cannot retrieve PRIMARYKEY from propably backreffed url=<xsl:value-of select="$p5:next"/></xsl:message>
- </xsl:otherwise>
-
- </xsl:choose>
- <!-- https://biuro.biall-net.pl/SE/version-git/wfs-data.php?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=default_db__x3A__BI_audit_MSIG_name%3ABI_audit_MSIG_name&sid=p3s8biqkc8jd4q0ihbqqhr8ueeub7hka9g8nagh3haiqrep37fr6hngspi0m3155v4gl0g2te86dd2hosir0f6l83t7t0j8fsoqq3k2&resolveDepth=4&resolve=all&PRIMARYKEY=7666&SRSNAME=EPSG%3A3003&startIndex=50000&maxFeatures20 -->
-
- </xsl:function>
-
- <xsl:template name="simpleTypeMakeOgcFilter_merge"><!-- do zrobienia polaczonego filtru OGC -->
- <xsl:param name="simpleTypeMakeOgcFilter" required="yes"/>
- <xsl:param name="xpath_dita" required="yes"/> <!-- @value -->
- <xsl:param name="xpath_value_dita" required="yes"/> <!-- @xpath_value -->
- <!-- <xsl:param name="get_wfs_recurse_xsl:xpath_dita" required="yes"/>
- <xsl:param name="get_wfs_recurse_xsl:xpath_value_dita" required="yes"/>-->
- <xsl:param name="RelatedFilter"/>
-
- <xsl:if test="$debug > 2"><xsl:message>#1754 name="simpleTypeMakeOgcFilter_merge"
- $simpleTypeMakeOgcFilter = <xsl:copy-of select="$simpleTypeMakeOgcFilter"></xsl:copy-of>
- $get_wfs_recurse_xsl:xpath_dita = <xsl:copy-of select="$xpath_dita"/>
- $get_wfs_recurse_xsl:xpath_value_dita = <xsl:copy-of select="$xpath_value_dita"/>
-
- #EOF
- </xsl:message>
- </xsl:if>
- <xsl:value-of select="'&Filter=<ogc:Filter>'"/>
- <xsl:variable name="Filter">
- <And>
- <xsl:for-each select="$RelatedFilter">
- <ogc:PropertyIsEqualTo>
- <ogc:PropertyName><xsl:value-of select="$xpath_dita"/></ogc:PropertyName>
- <ogc:Literal><xsl:value-of select="$xpath_value_dita"/></ogc:Literal>
- </ogc:PropertyIsEqualTo>
- </xsl:for-each>
- <ogc:PropertyIsEqualTo>
- <ogc:PropertyName><xsl:value-of select="$xpath_dita"/></ogc:PropertyName>
- <ogc:Literal><xsl:value-of select="$xpath_value_dita"/></ogc:Literal>
- </ogc:PropertyIsEqualTo>
- <And>
- <xsl:for-each select="$simpleTypeMakeOgcFilter/*">
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </And>
- </And>
- </xsl:variable>
- <xsl:apply-templates select="$Filter" mode="simpleTypeMakeOgcFilter_merge_apply"/>
- <xsl:value-of select="'</ogc:Filter>'"/>
- </xsl:template>
-
- <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 -->
- <xsl:param name="input_obj_with_xpath" required="yes"/>
- <xsl:param name="xpath" required="yes"/>
- <xsl:param name="xpath_value" required="yes"/>
- <xsl:variable name="xpath_value_token">
- <xsl:for-each select=" tokenize($xpath_value,'/')">
- <xsl:if test="$debug > 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>
- <xsl:if test="$input_obj_with_xpath/node()[@xpath=current()]">
- <xsl:copy-of select="$input_obj_with_xpath/node()[@xpath=current()]"/>
- </xsl:if><!-- todo to jest bledne ale dziala tymczasowo-->
- </xsl:for-each>
- </xsl:variable>
- <xsl:if test="$debug > 2"><xsl:message>#345 ustalam na <xsl:value-of select="$xpath_value_token/node()[1]/text()"/>;</xsl:message></xsl:if>
- <!--<xsl:value-of select="$xpath_value_token/node()[1]/text()"/>-->
- <xsl:value-of select="$xpath_value_token"/>
- </xsl:template>
-
-
-
- <!--${simpleSchema_dir}/${namespace_prefix_p5_tr_map}/${main_build_recurse_ant.tr_map_sed}.xml-->
- <xsl:template name="main">
-
- <xsl:param name="typeName" select="$typeName"/>
- <xsl:param name="api" select="$api"/>
- <xsl:param name="protocol" select="$protocol"/>
- <xsl:param name="targetNamespace_DEFAULTS_prefix" select="$targetNamespace_DEFAULTS_prefix"/>
- <!--<xsl:param name="xpath_value" select="$xpath_value"/>-->
- <xsl:param name="get_wfs_recurse_xsl:xpath"/>
- <xsl:message>#255 $typeName = <xsl:value-of select="$typeName"/>; $typeName.object = <xsl:value-of select="$typeName.object"/> </xsl:message>
- <!--<RelatedFeatureRoot>-->
- <!--<xsl:namespace name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA" select="'https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA'"/>-->
- <xsl:variable name="input_obj_with_xpath"><input_obj_with_xpath/></xsl:variable>
- <xsl:variable name="get_wfs_recurse_xsl:GetsimpleSchema" >
- <xsl:choose>
- <xsl:when test=" string-length($simpleSchema.xml) > 1">
- <xsl:message>#435 USING doc($simpleSchema.xml) </xsl:message>
- <xsl:copy-of select="doc($simpleSchema.xml)"/>
- </xsl:when>
- <xsl:when test=" string-length($typeName.object) > 1"/>
- <xsl:otherwise><!-- todo copy of or value of ? -->
- <xsl:copy-of select="get_wfs_recurse_xsl:GetsimpleSchema($typeName)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--<xsl:copy-of select="$get_wfs_recurse_xsl:GetsimpleSchema"/>-->
- <xsl:variable name="get_wfs_recurse_xsl:typeNameRealResource" >
- <xsl:choose>
- <xsl:when test=" string-length($typeName.object) > 1">
- <xsl:message>#448-B USING $typeName.object as get_wfs_recurse_xsl:typeNameRealResource </xsl:message>
- <xsl:value-of select="$typeName.object"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#448-C USING get_wfs_recurse_xsl:typeNameRealResource($get_wfs_recurse_xsl:GetsimpleSchema) to detect get_wfs_recurse_xsl:typeNameRealResource = detected=<xsl:value-of select="get_wfs_recurse_xsl:typeNameRealResource($get_wfs_recurse_xsl:GetsimpleSchema)"/> , from get_wfs_recurse_xsl:GetsimpleSchema = <xsl:value-of select="$get_wfs_recurse_xsl:GetsimpleSchema"/></xsl:message>
- <xsl:value-of select="get_wfs_recurse_xsl:typeNameRealResource($get_wfs_recurse_xsl:GetsimpleSchema)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="xpath_dita" select="$xpath"/>
- <xsl:variable name="xpath_value_dita" select="$xpath_value"/>
-
- <xsl:variable name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter" select="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter($get_wfs_recurse_xsl:GetsimpleSchema)"/>
- <xsl:variable name="get_wfs_recurse_xsl:RelatedFilter" select="get_wfs_recurse_xsl:RelatedFilter($get_wfs_recurse_xsl:GetsimpleSchema)"/>
- <xsl:variable name="OGC_Filter">
- <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
- <xsl:with-param name="simpleTypeMakeOgcFilter" select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
- <xsl:with-param name="RelatedFilter" select="$get_wfs_recurse_xsl:RelatedFilter"/>
- <xsl:with-param name="xpath_dita" select="$xpath"/>
- <xsl:with-param name="xpath_value_dita" select="$xpath_value"/>
- <!--<xsl:with-param name="Query.xml.local" select="$Query.xml.local"/>--><!-- Conditionally force query based on XML -->
- <!--<xsl:with-param name="get_wfs_recurse_xsl:xpath_dita" select="$xpath"/>-->
- <!--<xsl:with-param name="get_wfs_recurse_xsl:xpath_value_dita" select="$xpath_value"/>-->
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$debug > 3">
- <xpath_dita>
- <xsl:value-of select="$xpath_dita"></xsl:value-of>
- </xpath_dita>
- <xpath_value_dita>
- <xsl:value-of select="$xpath_value_dita"></xsl:value-of>
- </xpath_value_dita>
- <!-- <get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
- <xsl:copy-of select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
- </get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
- <Filter>
- <xsl:copy-of select="$OGC_Filter"/>
- </Filter>-->
- </xsl:if>
- <!--<xsl:variable name="request_string" select="concat('?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&SRSNAME=EPSG:3003')"/>--> <!-- &MAXFEATURES=15 -->
-
- <xsl:variable name="request_string">
- <xsl:call-template name="get_wfs_recurse_xsl:request_string">
- <xsl:with-param name="OGC_Filter" select="$OGC_Filter"/>
- <xsl:with-param name="REQUEST.TYPE" select="'GetFeature'"/>
- <xsl:with-param name="REQUEST.TYPENAME" select="$get_wfs_recurse_xsl:typeNameRealResource"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!--<xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>-->
- <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"/>
- p5:links.recurse_level.limit = <xsl:value-of select="$p5:links.recurse_level.limit"/>
- p5:links.next.recurse_level.limit = <xsl:value-of select="$p5:links.next.recurse_level.limit"/>
- resolveDepth = <xsl:value-of select="$resolveDepth"/>
-
- </xsl:message>
- <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($request_string)"/>
- <xsl:if test="$debug > 5">
- <wfs_response>
- <request>Retrieving <xsl:value-of select="$request_string"/></request>
- <oryg>https:// biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:CRM_PROCES&SRSNAME=EPSG:3003&MAXFEATURES=15</oryg>
- <test>https://a.binder:@biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:PROCES_INIT&SRSNAME=EPSG:3003&MAXFEATURES=15</test>
-
- <!--<xsl:copy-of select="$wfs_response"/>-->
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>
- </wfs_response>
- </xsl:if>
- <xsl:variable name="get_wfs_recurse_xsl:context.nodes">
- <get_wfs_recurse_xsl:context.nodes>
- <xsl:apply-templates mode="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:wfs_response"/>
- </get_wfs_recurse_xsl:context.nodes>
- </xsl:variable>
- <xsl:variable name="get_wfs_recurse_xsl:context.PRIMARYKEY">
- <get_wfs_recurse_xsl:context.PRIMARYKEY>
- <xsl:for-each select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*">
- <get_wfs_recurse_xsl:nodes>
- <xsl:attribute name="fid" select="@fid"/>
- </get_wfs_recurse_xsl:nodes>
- </xsl:for-each>
- </get_wfs_recurse_xsl:context.PRIMARYKEY>
- </xsl:variable>
- <xsl:if test="number($debug) > 3">
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.nodes"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test=" string-length($api_recurse) > 0">
- <xsl:if test="$get_wfs_recurse_xsl:wfs_response/ServiceExceptionReport" xpath-default-namespace="http://www.opengis.net/ogc">
- <xsl:message terminate="yes">ServiceException! Error with query <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//ServiceException/text()" xpath-default-namespace="http://www.opengis.net/ogc"/></xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:wfs_response//p5:next">
- <xsl:message> #360 to parse to retrieve links and merge xml <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//p5:next/text()"/></xsl:message>
- <!--<xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/namespace::node()"/> <!-\- [ not(contains( local-name(),'wfs'))] -\->
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/namespace::node()"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*/namespace::node()"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember//*/namespace::node()"/>-->
- <xsl:choose>
- <xsl:when test="$noRelatedFeatureRoot">
- <xsl:apply-templates mode="p5:links.evaluate" select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*" xpath-default-namespace="http://www.opengis.net/wfs">
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <RelatedFeatureRoot>
- <xsl:apply-templates mode="p5:links.evaluate" select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*" xpath-default-namespace="http://www.opengis.net/wfs">
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- </xsl:apply-templates>
- </RelatedFeatureRoot>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$noRelatedFeatureRoot">
- <xsl:if test="$debug > 3"><xsl:message>#533 going after wfs:FeatureCollection/gml:featureMember/*...</xsl:message></xsl:if>
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*"/>
- <xsl:apply-templates mode="p5:links.evaluate" select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*" xpath-default-namespace="http://www.opengis.net/wfs">
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <RelatedFeatureRoot>
- <xsl:if test="$debug > 3"><xsl:message>#533 going after wfs:FeatureCollection/gml:featureMember/*...</xsl:message></xsl:if>
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*"/>
- <xsl:apply-templates mode="p5:links.evaluate" select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/gml:featureMember/*" xpath-default-namespace="http://www.opengis.net/wfs">
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- </xsl:apply-templates>
- </RelatedFeatureRoot>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#563 applying root without $api_recurse. </xsl:message>
- <xsl:choose>
- <xsl:when test="$noRelatedFeatureRoot">
- <xsl:apply-templates mode="after_first_ant_assing_vars" select="$get_wfs_recurse_xsl:GetsimpleSchema">
- <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- <xsl:with-param name="resolveDepth.current" select="1"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <RelatedFeatureRoot>
- <xsl:apply-templates mode="after_first_ant_assing_vars" select="$get_wfs_recurse_xsl:GetsimpleSchema">
- <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- <xsl:with-param name="resolveDepth.current" select="1"/>
- </xsl:apply-templates>
- </RelatedFeatureRoot>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:otherwise>
- </xsl:choose>
- <!--</RelatedFeatureRoot>-->
- </xsl:template>
-
-
- <xsl:template match="*[@xlink:href]" mode="p5:links.evaluate" xpath-default-namespace="http://www.opengis.net/wfs">
- <xsl:param name="p5:links.recurse_level" select="1"/>
- <xsl:param name="p5:links.next.recurse_level" select="1"/>
- <xsl:param name="get_wfs_recurse_xsl:context.nodes" required="yes"/>
- <xsl:param name="get_wfs_recurse_xsl:context.PRIMARYKEY" required="yes"/>
- <xsl:param name="debug.last_wfs_request" required="yes"/>
- <xsl:variable name="p5:fid" select="get_wfs_recurse_xsl:REQUEST.fid(@xlink:href)"/>
- <!--<xlink:href.evaluate>-->
- <!-- <xsl:copy>
- <xsl:copy-of select="@*"/>-->
- <xsl:if test="number($debug) > 3">
- <xlink:href.debug509>
- <xsl:attribute name="debug.last_wfs_request" select="$debug.last_wfs_request"/>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.nodes"/>
- </xlink:href.debug509>
- </xsl:if>
- <xsl:message>#516-A name()<xsl:value-of select="name()"/>; ORIGINAL_@xlink:href=<xsl:value-of select="@xlink:href"/>;</xsl:message>
- <xsl:comment>#516-A name()<xsl:value-of select="name()"/>; ORIGINAL_@xlink:href=<xsl:value-of select="@xlink:href"/>;</xsl:comment>
- <xsl:variable name="xlink:request_string">
- <xsl:apply-templates mode="xlink:request_string" select=".">
- <xsl:with-param name="p5:links.recurse_level" select="$p5:links.recurse_level"/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:message>#516-A anchestors.count(<xsl:value-of select="count(ancestor::node())"/>); context.PRIMARYKEY count(<xsl:value-of select="count($get_wfs_recurse_xsl:context.PRIMARYKEY//*[@fid])"/>); previous @fid=count(<xsl:value-of select="count(root()//*[@fid])"/>); get_wfs_recurse_xsl:context.nodes count(<xsl:value-of select="count($get_wfs_recurse_xsl:context.nodes//*[@fid])"/>); debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#516-A anchestors.count(<xsl:value-of select="count(ancestor::node())"/>); context.PRIMARYKEY count(<xsl:value-of select="count($get_wfs_recurse_xsl:context.PRIMARYKEY//*[@fid])"/>); previous @fid=count(<xsl:value-of select="count(root()//*[@fid])"/>); get_wfs_recurse_xsl:context.nodes count(<xsl:value-of select="count($get_wfs_recurse_xsl:context.nodes//*[@fid])"/>); debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- <!--<xsl:message>#401 previous @fid
- <xsl:for-each select="root()//*[@fid]">
- <xsl:value-of select="@fid"/>
- </xsl:for-each>
- </xsl:message>-->
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:context.nodes//*[@fid = get_wfs_recurse_xsl:REQUEST.fid( current()/@xlink:href)]">
- <xsl:message>#398-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING @xlink:href=<xsl:value-of select="@xlink:href"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#398-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/> BYPASSING @xlink:href=<xsl:value-of select="@xlink:href"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- </xsl:when>
- <xsl:when test="root()//*[number(@root.distance) < number($p5:links.loop.context.nodes.min.distance) and @fid = get_wfs_recurse_xsl:REQUEST.fid( current()/@xlink:href)]">
- <xsl:message>#398-A2 match="*[@xlink:href]" - LOOP DETECTED for <xsl:value-of select="root()//*[@fid = get_wfs_recurse_xsl:REQUEST.fid( current()/@xlink:href)]/concat(@fid,' dist:',@root.distance)"/> at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING @xlink:href=<xsl:value-of select="@xlink:href"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#398-A2 match="*[@xlink:href]" - LOOP DETECTED for <xsl:value-of select="root()//*[@fid = get_wfs_recurse_xsl:REQUEST.fid( current()/@xlink:href)]/concat(@fid,' dist:',@root.distance)"/> at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/> BYPASSING @xlink:href=<xsl:value-of select="@xlink:href"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- </xsl:when>
- <xsl:when test="p5:links.recurse_level.limit($p5:links.recurse_level)">
- <xsl:message>#398-B match="*[@xlink:href]" HIT LIMIT p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING @xlink:href=<xsl:value-of select="@xlink:href"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#398-B match="*[@xlink:href]" HIT LIMIT p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING @xlink:href=<xsl:value-of select="@xlink:href"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- <xsl:copy-of select="."/>
- </xsl:when>
- <xsl:when test=" string-length($xlink:request_string) = 0">
- <xsl:message>#402-C match="*[@xlink:href]" stopped recursion due to ERROR in empty $xlink:request_string - DEBUGGING TODO 2018-01-5; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#402-C match="*[@xlink:href]" stopped recursion due to ERROR in empty $xlink:request_string - DEBUGGING TODO 2018-01-5; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#398-D match="*[@xlink:href]"-B count(.)=<xsl:value-of select="count(.)"/>; continuing still digging at @xlink:href xlink:request_string=<xsl:value-of select="$xlink:request_string"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#398-D match="*[@xlink:href]"-B count(.)=<xsl:value-of select="count(.)"/>; continuing still digging at @xlink:href xlink:request_string=<xsl:value-of select="$xlink:request_string"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
-
- <!--<xsl:variable name="xlink:request_string">
- <xsl:apply-templates mode="xlink:request_string" select="."/>
- </xsl:variable>-->
- <xsl:apply-templates select=" get_wfs_recurse_xsl:wfs_response($xlink:request_string)" mode="p5:links.evaluate">
- <xsl:with-param name="p5:links.recurse_level" select="number($p5:links.recurse_level) + 1"/>
- <xsl:with-param name="p5:links.next.recurse_level" select="1"/> <!-- $p5:links.next.recurse_level TODO researching start from beginning -->
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="get_wfs_recurse_xsl:context.PRIMARYKEY.merge($get_wfs_recurse_xsl:context.PRIMARYKEY,$p5:fid)"/>
- <xsl:with-param name="debug.last_wfs_request" select="$xlink:request_string"/>
- </xsl:apply-templates>
- </xsl:otherwise>
-
- </xsl:choose>
-
- <!--</xsl:copy>-->
- <!--</xlink:href.evaluate>-->
- </xsl:template>
-
-
- <xsl:template match="*" mode="p5:links.evaluate" xpath-default-namespace="http://www.opengis.net/wfs">
- <xsl:param name="p5:links.recurse_level" select="1"/>
- <xsl:param name="p5:links.next.recurse_level" select="1"/>
- <xsl:param name="get_wfs_recurse_xsl:context.nodes" required="yes"/>
- <xsl:param name="get_wfs_recurse_xsl:context.PRIMARYKEY" required="yes"/>
- <xsl:param name="debug.last_wfs_request" required="yes"/>
- <!-- <xsl:element name="{name()}" inherit-namespaces="yes">
- <xsl:copy-of select="namespace::node()"/>-->
- <xsl:choose>
- <xsl:when test="count($get_wfs_recurse_xsl:context.nodes//*[@fid = current()/@fid ]) > 1">
- <xsl:message>#613-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING current()/@fid=<xsl:value-of select="@fid"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#613-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING current()/@fid=<xsl:value-of select="@fid"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- <xsl:if test="number($debug) > 3">
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.nodes"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy><!-- debug -->
- <xsl:copy-of select="@*"/>
- <!--<xsl:attribute name="debug.566"> match=* mode=p5:links.evaluate</xsl:attribute>-->
- <xsl:apply-templates mode="xlink:href.evaluate" select="@xlink:href">
- <xsl:with-param name="p5:links.recurse_level" select="$p5:links.recurse_level"/>
- <xsl:with-param name="p5:links.next.recurse_level" select="$p5:links.next.recurse_level"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$debug.last_wfs_request"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="p5:links.evaluate">
- <xsl:with-param name="p5:links.recurse_level" select="$p5:links.recurse_level"/>
- <xsl:with-param name="p5:links.next.recurse_level" select="$p5:links.next.recurse_level"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$debug.last_wfs_request"/>
- </xsl:apply-templates>
- <!--</xsl:element>-->
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
-
-
- <!--<xsl:element name="{name()}" inherit-namespaces="yes" xpath-default-namespace="http://www.opengis.net/wfs">
-
- <xsl:apply-templates mode="p5:links.evaluate"/>
- </xsl:element>-->
-
- </xsl:template>
-
- <xsl:function name="p5:links.recurse_level.limit">
- <xsl:param name="p5:links.recurse_level"/>
- <xsl:choose>
- <xsl:when test="number($p5:links.recurse_level) >= number($p5:links.recurse_level.limit)">
- <xsl:value-of select="'limit hit'"/>
- <xsl:message>#431-R LIMIT HIT p5:links.recurse_level.limit($p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>);</xsl:message>
- <xsl:comment>#431-R LIMIT HIT p5:links.recurse_level.limit($p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>)</xsl:comment>
- </xsl:when>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="p5:links.next.recurse_level.limit">
- <xsl:param name="p5:links.next.recurse_level"/>
- <xsl:choose>
- <xsl:when test="number($p5:links.next.recurse_level.limit) > number($p5:links.next.recurse_level.limit)">
- <xsl:value-of select="'limit hit'"/>
- <xsl:message>#431-N LIMIT HIT p5:links.next.recurse_level.limit(<xsl:value-of select="$p5:links.next.recurse_level.limit"/>) at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>;</xsl:message>
- <xsl:comment>#431-N LIMIT HIT p5:links.next.recurse_level.limit(<xsl:value-of select="$p5:links.next.recurse_level.limit"/>) at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>;</xsl:comment>
- </xsl:when>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:php_session_id_ok.string">
- <xsl:param name="php_session_id_ok.string"/>
- <xsl:if test=" string-length($php_session_id_ok.string) > 0">
- <xsl:value-of select="concat('&sid=',normalize-space($php_session_id_ok.string))"/>
- </xsl:if>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:api_recurse.request">
- <xsl:param name="api_recurse"/>
- <xsl:param name="p5:links.recurse_level"/>
- <xsl:choose>
- <xsl:when test="$api_recurse and ( ( number($p5:links.recurse_level) + number($resolveDepth) ) > $p5:links.recurse_level.limit )">
- <xsl:message>#668 reducing $resolveDepth to $p5:links.recurse_level.limit-$p5:links.recurse_level == <xsl:value-of select="($p5:links.recurse_level.limit - $p5:links.recurse_level )"/> to not extend expected deep traverse </xsl:message>
- <xsl:value-of select="concat('&resolveDepth=',($p5:links.recurse_level.limit - $p5:links.recurse_level ),'&resolve=all')"/>
- </xsl:when>
- <xsl:when test="$api_recurse and number($p5:links.recurse_level)">
- <xsl:value-of select="concat('&resolveDepth=',$resolveDepth,'&resolve=all')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:api_recurse.request">
- <xsl:param name="api_recurse"/>
- <xsl:choose>
- <xsl:when test="$api_recurse">
- <xsl:value-of select="concat('&resolveDepth=',$resolveDepth,'&resolve=all')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:username_and_pass">
- <xsl:param name="php_session_id_ok.string"/>
- <xsl:choose>
- <xsl:when test="string-length($php_session_id_ok.string) > 0"/>
- <xsl:otherwise><xsl:value-of select="concat($username,':',$username.pass,'@')"/></xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:api">
- <xsl:param name="xlink:href"/>
- <xsl:variable name="string_tokens" select="count(tokenize($xlink:href,'/'))"/>
- <xsl:variable name="get_wfs_recurse_xsl:api">
- <xsl:for-each select="tokenize($xlink:href,'/')[ position() < $string_tokens]">
- <xsl:value-of select="."/><xsl:text>/</xsl:text>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test=" contains( substring-after($get_wfs_recurse_xsl:api/text(),'://'), substring-before($api,'/'))">
- <xsl:message>#476 TODO using default parameter from $api=<xsl:value-of select="$api"/> instead of detected <xsl:value-of select="substring-after($get_wfs_recurse_xsl:api/text(),'://')"/> consider using binding $TargetNamespaceBindingsApiUrl</xsl:message>
- <xsl:value-of select="$api"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select=" substring-after($get_wfs_recurse_xsl:api/text(),'://')"/>
- </xsl:otherwise>
- </xsl:choose>
-
- <!--<xsl:value-of select="tokenize($xlink:href,'/')[ 1 to count(tokenize($xlink:href,'.'))]"/>-->
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:REQUEST.fid">
- <xsl:param name="xlink:href"/>
- <xsl:choose>
- <xsl:when test="substring-after($xlink:href,'#')">
- <xsl:value-of select=" substring-after($xlink:href,'#')"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="false()"/></xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:REQUEST.TYPE.PRIMARYKEY">
- <xsl:param name="xlink:href"/>
-
- <xsl:choose>
- <xsl:when test=" string-length(tokenize($xlink:href,'\.')[ count(tokenize($xlink:href,'\.'))]) > 0">
- <xsl:value-of select="concat('&PRIMARYKEY=',tokenize($xlink:href,'\.')[ count(tokenize($xlink:href,'\.')) ])"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="no">#495 ERROR with detecting get_wfs_recurse_xsl:REQUEST.TYPE.PRIMARYKEY from <xsl:value-of select="$xlink:href"/>
- tokens count=<xsl:value-of select="count(tokenize($xlink:href,'\.'))"/>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
- <xsl:function name="get_wfs_recurse_xsl:protocol">
- <xsl:param name="xlink:href"/>
- <xsl:value-of select=" concat(substring-before($xlink:href,'://'),'://')"/>
- </xsl:function>
-
- <xsl:template match="*[@xlink:href]" mode="xlink:request_string">
- <xsl:param name="protocol" select="get_wfs_recurse_xsl:protocol(@xlink:href)"/>
- <xsl:param name="api" select="get_wfs_recurse_xsl:api(@xlink:href)"/>
- <xsl:param name="targetNamespace_DEFAULTS_prefix" select="$targetNamespace_DEFAULTS_prefix"/>
- <xsl:param name="username" select="$username"/>
- <xsl:param name="username.pass" select="$username.pass"/>
- <xsl:param name="REQUEST.SERVICE" select="'WFS'"/>
- <xsl:param name="REQUEST.VERSION" select="'1.0.0'"/>
- <xsl:param name="REQUEST.TYPE" select="'GetFeature'"/>
- <!--<xsl:param name="REQUEST.MAXFEATURES" />-->
- <xsl:param name="REQUEST.TYPENAME" select="name()"/>
- <xsl:param name="OGC_Filter"/>
- <xsl:param name="REQUEST.SRSNAME" select="'EPSG:3003'"/>
- <xsl:param name="p5:links.recurse_level"/>
- <xsl:param name="api.local_location" select="'SE/version-git/wfs-data.php/default_db/'"/>
- <xsl:variable name="php_session_id_ok.string" select="get_wfs_recurse_xsl:php_session_id_ok.string($php_session_id_ok.string)"/>
- <xsl:variable name="api_recurse.request" select="get_wfs_recurse_xsl:api_recurse.request($api_recurse)"/>
- <xsl:variable name="username_and_pass" select="get_wfs_recurse_xsl:username_and_pass($php_session_id_ok.string)"/>
- <xsl:variable name="REQUEST.TYPE.PRIMARYKEY" select="get_wfs_recurse_xsl:REQUEST.TYPE.PRIMARYKEY(@xlink:href)"/>
- <xsl:variable name="REQUEST.MAXFEATURES">
- <xsl:choose>
- <xsl:when test="contains(@xlink:href,'&maxFeatures=10')">
- <xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/>
- </xsl:when>
- <xsl:when test="contains(@xlink:href,'&maxFeatures=20')">
- <xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/>
- </xsl:when>
- <xsl:when test="contains(@xlink:href,'maxFeatures')"/>
- <xsl:otherwise><xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:if test="number($debug) > 3"><xsl:message>#497 detected $api = <xsl:value-of select="$api"/>; </xsl:message>
- <xsl:message>#497 REQUEST.TYPE.PRIMARYKEY=<xsl:value-of select="$REQUEST.TYPE.PRIMARYKEY"/>;</xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test=" string-length($REQUEST.TYPE.PRIMARYKEY) > 0">
- <xsl:value-of select="concat($protocol,$username_and_pass,$api,'?SERVICE=',$REQUEST.SERVICE,'&VERSION=',$REQUEST.VERSION,'&REQUEST=',$REQUEST.TYPE,'&TYPENAME=',$REQUEST.TYPENAME,$php_session_id_ok.string,$api_recurse.request,$REQUEST.TYPE.PRIMARYKEY,'&SRSNAME=',$REQUEST.SRSNAME,$REQUEST.MAXFEATURES)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#532 ERROR with requests - debug it and stop recurse</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
-
- </xsl:template>
-
-
- <xsl:function name="get_wfs_recurse_xsl:wfs_response">
- <xsl:param name="request_string"/>
- <xsl:message>#741 quering wfs for request_string= <xsl:value-of select="$request_string"/> ;</xsl:message>
- <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($request_string)"/>
- <xsl:if test="$get_wfs_recurse_xsl:wfs_response/ServiceExceptionReport" xpath-default-namespace="http://www.opengis.net/ogc">
- <xsl:message terminate="yes"> Error with query <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//ServiceException/text()" xpath-default-namespace="http://www.opengis.net/ogc"/></xsl:message>
- </xsl:if>
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>
- </xsl:function>
-
-
- <xsl:template match="@*" mode="p5:links.evaluate">
- <xsl:copy-of select="."/>
- </xsl:template>
- <xsl:template match="text()" mode="p5:links.evaluate">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template match="p5:links" mode="p5:links.evaluate">
- <xsl:param name="p5:links.recurse_level" select="1"/>
- <xsl:param name="p5:links.next.recurse_level" select="1"/>
- <xsl:param name="get_wfs_recurse_xsl:context.nodes" required="yes"/>
- <xsl:param name="get_wfs_recurse_xsl:context.PRIMARYKEY" required="yes"/>
- <xsl:param name="debug.last_wfs_request" required="yes"/>
- <xsl:variable name="php_session_id_ok.string">
- <xsl:if test=" string-length($php_session_id_ok.string) > 0">
- <xsl:value-of select="concat('&sid=',normalize-space($php_session_id_ok.string))"/>
- </xsl:if>
- </xsl:variable>
- <!--<xsl:variable name="api_recurse.request">
- <xsl:choose>
- <xsl:when test="$api_recurse">
- <xsl:value-of select="concat('&resolveDepth=',$resolveDepth,'&resolve=all')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>-->
- <!-- <xsl:copy>-->
- <p5:links><xsl:copy-of select="*"/></p5:links>
-
- <xsl:variable name="p5:fid" select="p5:fid(p5:next/text())"/>
- <xsl:message>#684 debug match="p5:links" detected $p5:fid = <xsl:value-of select="$p5:fid"/></xsl:message>
- <xsl:comment>#684 debug match="p5:links" detected $p5:fid = <xsl:value-of select="$p5:fid"/></xsl:comment>
- <xsl:if test="number($debug) > 3">
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:copy-of select="$get_wfs_recurse_xsl:context.nodes"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:context.nodes//*[@fid = $p5:fid ]">
- <xsl:message>#430-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING p5:next/text()=<xsl:value-of select="p5:next/text()"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#430-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/> BYPASSING p5:next/text()=<xsl:value-of select="p5:next/text()"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- </xsl:when>
- <xsl:when test="number($p5:links.recurse_level) >= number($p5:links.recurse_level.limit)">
- <xsl:message>#430 STOPPED digging links by HIT $p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>;</xsl:message>
- <xsl:comment>#430 STOPPED digging links by HIT $p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>;</xsl:comment>
- </xsl:when>
- <xsl:when test="$get_wfs_recurse_xsl:context.PRIMARYKEY//*[@fid = $p5:fid]">
- <xsl:message> #690 STOPPED match="p5:links" DETECTED PRIMARYKEY FUTURE LOOP BY PRIMARY KEY $p5:fid=<xsl:value-of select="$p5:fid"/>;</xsl:message>
- <xsl:comment> #690 STOPPED match="p5:links" DETECTED PRIMARYKEY FUTURE LOOP BY PRIMARY KEY $p5:fid=<xsl:value-of select="$p5:fid"/>;</xsl:comment>
- </xsl:when>
- <xsl:when test="$get_wfs_recurse_xsl:context.PRIMARYKEY//*[@fid = $p5:fid]">
- <xsl:message> #691 STOPPED match="p5:links" DETECTED FUTURE LOOP BY PRIMARY KEY $p5:fid=<xsl:value-of select="$p5:fid"/>;</xsl:message>
- <xsl:comment> #691 STOPPED match="p5:links" DETECTED FUTURE LOOP BY PRIMARY KEY $p5:fid=<xsl:value-of select="$p5:fid"/>;</xsl:comment>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="MAXFEATURES.request">
- <xsl:choose>
- <xsl:when test="contains(p5:next/text(),'maxFeatures=10')">
- <xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/>
- </xsl:when>
- <xsl:when test="contains(p5:next/text(),'maxFeatures=20')">
- <xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/>
- </xsl:when>
- <xsl:when test="contains(p5:next/text(),'maxFeatures')"/>
- <xsl:otherwise><xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="request_string" select="concat(p5:next/text(),$php_session_id_ok.string,get_wfs_recurse_xsl:api_recurse.request($api_recurse,$p5:links.recurse_level),$MAXFEATURES.request)"/> <!-- ,'&maxFeatures=999' -->
- <xsl:message>#415 $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; requesting p5:links <xsl:value-of select="$request_string"/> ; orig from next (<xsl:copy-of select="p5:next/@*"/>)</xsl:message>
- <xsl:comment>#415 $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; requesting p5:links <xsl:value-of select="$request_string"/> ; orig from next (<xsl:copy-of select="p5:next/@*"/>)</xsl:comment>
- <!--<request_string>
- <xsl:copy-of select="$request_string"/>
- </request_string>-->
- <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($request_string)"/>
-
- <xsl:if test="$get_wfs_recurse_xsl:wfs_response/ServiceExceptionReport" xpath-default-namespace="http://www.opengis.net/ogc">
- <xsl:message terminate="yes"> Error with query <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//ServiceException/text()" xpath-default-namespace="http://www.opengis.net/ogc"/></xsl:message>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/@next">
- <!--<debug.438>-->
- <xsl:comment>360-recurse-A $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; to parse to retrieve links and merge xml <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//p5:next/text()"/></xsl:comment>
- <xsl:message> #360-recurse-A $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; to parse to retrieve links and merge xml <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//p5:next/text()"/></xsl:message>
- <xsl:apply-templates mode="#current" select="$get_wfs_recurse_xsl:wfs_response">
- <xsl:with-param name="p5:links.recurse_level" select="number($p5:links.recurse_level)"/> <!-- + 1 --><!-- setting to 1 again to research child node -->
- <xsl:with-param name="p5:links.next.recurse_level" select="number($p5:links.next.recurse_level) + 1"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="get_wfs_recurse_xsl:context.nodes.merge($get_wfs_recurse_xsl:context.nodes,$get_wfs_recurse_xsl:wfs_response)"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="get_wfs_recurse_xsl:context.PRIMARYKEY.merge($get_wfs_recurse_xsl:context.PRIMARYKEY,$p5:fid)"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- </xsl:apply-templates>
- <!--</debug.438>-->
- </xsl:when>
- <xsl:when test="$get_wfs_recurse_xsl:wfs_response//p5:next">
- <!--<debug.441>-->
- <xsl:comment> #360-recurse-B $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; to parse to retrieve links and merge xml <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//p5:next/text()"/></xsl:comment>
- <xsl:message> #360-recurse-B $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; to parse to retrieve links and merge xml <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//p5:next/text()"/></xsl:message>
- <xsl:apply-templates mode="#current" select="$get_wfs_recurse_xsl:wfs_response">
- <xsl:with-param name="p5:links.recurse_level" select="$p5:links.recurse_level"/> <!-- + 1 ) -->
- <xsl:with-param name="p5:links.next.recurse_level" select=" number($p5:links.next.recurse_level) + 1"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="get_wfs_recurse_xsl:context.nodes.merge($get_wfs_recurse_xsl:context.nodes,$get_wfs_recurse_xsl:wfs_response)"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="get_wfs_recurse_xsl:context.PRIMARYKEY.merge($get_wfs_recurse_xsl:context.PRIMARYKEY,$p5:fid)"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- </xsl:apply-templates>
- <!--</debug.441>-->
- </xsl:when>
- <xsl:otherwise>
- <!--<debug.447>-->
- <xsl:comment> #360-recurse-C $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; to parse to retrieve links and merge xml <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//p5:next/text()"/></xsl:comment>
- <xsl:message> #360-recurse-C $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; to parse to retrieve links and merge xml <xsl:value-of select="$get_wfs_recurse_xsl:wfs_response//p5:next/text()"/></xsl:message>
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response/wfs:FeatureCollection/@*"/>
- <xsl:apply-templates mode="#current" select="$get_wfs_recurse_xsl:wfs_response">
- <xsl:with-param name="p5:links.recurse_level" select="$p5:links.recurse_level"/> <!-- +1 -->
- <xsl:with-param name="p5:links.next.recurse_level" select=" number($p5:links.next.recurse_level) + 1"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="get_wfs_recurse_xsl:context.nodes.merge($get_wfs_recurse_xsl:context.nodes,$get_wfs_recurse_xsl:wfs_response)"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="get_wfs_recurse_xsl:context.PRIMARYKEY.merge($get_wfs_recurse_xsl:context.PRIMARYKEY,$p5:fid)"/>
- <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
- </xsl:apply-templates>
- <!--</debug.447>-->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-
- <!--</xsl:copy>-->
- </xsl:template>
-
-
- <xsl:template match="wfs:FeatureCollection[not(gml:featureMember/*)]" mode="p5:links.evaluate" >
- <xsl:message>#461 finished digging at <xsl:value-of select="@next"/></xsl:message>
- </xsl:template>
-
-
-
- <xsl:template match="wfs:FeatureCollection[@next and gml:featureMember/*]" mode="p5:links.evaluate" >
- <xsl:param name="p5:links.recurse_level" select="1"/>
- <xsl:param name="p5:links.next.recurse_level" select="1"/>
- <xsl:param name="get_wfs_recurse_xsl:context.PRIMARYKEY" required="yes"/>
- <xsl:param name="get_wfs_recurse_xsl:context.nodes" required="yes"/>
- <xsl:param name="debug.last_wfs_request" required="yes"/>
-
- <xsl:variable name="php_session_id_ok.string">
- <xsl:if test=" string-length($php_session_id_ok.string) > 0">
- <xsl:value-of select="concat('&sid=',normalize-space($php_session_id_ok.string))"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="MAXFEATURES.request">
- <xsl:choose>
- <xsl:when test="contains(@next,'&maxFeatures=10')">
- <xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/>
- </xsl:when>
- <xsl:when test="contains(@next,'&maxFeatures=20')">
- <xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/>
- </xsl:when>
- <xsl:when test="contains(@next,'maxFeatures')"/>
- <xsl:otherwise><xsl:value-of select="concat('&maxFeatures=',$MAXFEATURES)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="request_string" select="concat(@next,$MAXFEATURES.request)"/>
-
- <!--<xsl:variable name="api_recurse.request">
- <xsl:choose>
- <xsl:when test="1=1"></xsl:when>
- <xsl:when test="$api_recurse">
- <xsl:value-of select="concat(@next,'&resolveDepth=',$resolveDepth,'&resolve=all')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>-->
-
-
- <xsl:variable name="p5:fid">
- <xsl:choose>
- <xsl:when test="contains(@next,'PRIMARYKEY=')">
- <xsl:apply-templates select="@next" mode="p5:fid"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#833 cannot get PRIMARYKEY from Backreffed - check loop in another leaf from <xsl:value-of select="@next"/></xsl:message>
- <xsl:comment>#833 cannot get PRIMARYKEY from Backreffed - check loop in another leaf from <xsl:value-of select="@next"/></xsl:comment>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- ,'&maxFeatures=999' -->
- <xsl:message>#511 p5:fid=<xsl:value-of select="$p5:fid"/> $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; requesting @next <xsl:value-of select="$request_string"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#511 p5:fid=<xsl:value-of select="$p5:fid"/> $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; requesting @next <xsl:value-of select="$request_string"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- <!--<request_string>
- <xsl:copy-of select="$request_string"/>
- </request_string>-->
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:context.nodes//*[@fid = current()/@fid ]">
- <xsl:message>#692-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; BYPASSING current(); debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#692-A1 match="*[@xlink:href]" - LOOP CONTEXT.nodes DETECTED at p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; at p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/> BYPASSING current() debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- </xsl:when>
- <xsl:when test="number($p5:links.recurse_level) > $p5:links.recurse_level.limit">
- <xsl:message>#692-R stopped digging for new p5:fid=<xsl:value-of select="$p5:fid"/> $p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#692-R stopped digging for new p5:fid=<xsl:value-of select="$p5:fid"/> $p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- </xsl:when>
- <xsl:when test="number($p5:links.next.recurse_level) > $p5:links.next.recurse_level.limit">
- <xsl:message>#692-L stopped digging for new p5:fid=<xsl:value-of select="$p5:fid"/> $p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:message>
- <xsl:comment>#692-L stopped digging for new p5:fid=<xsl:value-of select="$p5:fid"/> $p5:links.recurse_level.limit at <xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- </xsl:when>
- <xsl:otherwise>
-
- <xsl:comment>debug.current lower; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
- <xsl:apply-templates mode="#current">
- <xsl:with-param name="p5:links.recurse_level" select="number($p5:links.recurse_level) + 1"/>
- <xsl:with-param name="p5:links.next.recurse_level" select="$p5:links.next.recurse_level"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="get_wfs_recurse_xsl:context.PRIMARYKEY.merge($get_wfs_recurse_xsl:context.PRIMARYKEY,$p5:fid)"/>
- <xsl:with-param name="debug.last_wfs_request" select="$debug.last_wfs_request"/>
- </xsl:apply-templates>
- <xsl:comment>debug.current upper / debug.reffered lower; debug.last_wfs_request=<xsl:value-of select="$debug.last_wfs_request"/>;</xsl:comment>
-
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:context.PRIMARYKEY//*[@fid = $p5:fid]">
- <xsl:message>#797 detected FUTURE LOOP for fid=<xsl:value-of select="$p5:fid"/> in match="wfs:FeatureCollection[@next </xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($request_string)"/>
- <xsl:choose>
- <xsl:when test="$get_wfs_recurse_xsl:wfs_response//gml:featureMember/*">
- <xsl:apply-templates mode="#current" select="$get_wfs_recurse_xsl:wfs_response">
- <xsl:with-param name="p5:links.recurse_level" select="number($p5:links.recurse_level)"/> <!-- + 1 -->
- <xsl:with-param name="p5:links.next.recurse_level" select="number($p5:links.next.recurse_level) + 1"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="get_wfs_recurse_xsl:context.nodes.merge($get_wfs_recurse_xsl:context.nodes,$get_wfs_recurse_xsl:wfs_response)"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="get_wfs_recurse_xsl:context.PRIMARYKEY.merge($get_wfs_recurse_xsl:context.PRIMARYKEY,$p5:fid)"/>
- <xsl:with-param name="debug.last_wfs_request" select="$debug.last_wfs_request"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
-
- <xsl:message>#498 not any childs</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-
-
- <!--</debug_reffered>-->
- <!--</debug.470>-->
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
- <xsl:template match="wfs:FeatureCollection" mode="p5:links.evaluate" >
- <xsl:param name="p5:links.recurse_level" select="1"/>
- <xsl:param name="p5:links.next.recurse_level" select="1"/>
- <xsl:param name="get_wfs_recurse_xsl:context.nodes" required="yes"/>
- <xsl:param name="get_wfs_recurse_xsl:context.PRIMARYKEY" required="yes"/>
- <xsl:param name="debug.last_wfs_request" required="yes"/>
- <xsl:message>#538 match wfs:FeatureCollection $p5:links.recurse_level=<xsl:value-of select="$p5:links.recurse_level"/>; p5:links.next.recurse_level=<xsl:value-of select="$p5:links.next.recurse_level"/>;</xsl:message>
- <xsl:apply-templates mode="#current">
- <xsl:with-param name="p5:links.recurse_level" select="(number($p5:links.recurse_level) + 1)"/>
- <xsl:with-param name="p5:links.next.recurse_level" select="$p5:links.next.recurse_level"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$debug.last_wfs_request"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="gml:featureMember" mode="p5:links.evaluate">
- <xsl:param name="p5:links.recurse_level" select="1"/>
- <xsl:param name="p5:links.next.recurse_level" select="1"/>
- <xsl:param name="get_wfs_recurse_xsl:context.nodes" required="yes"/>
- <xsl:param name="get_wfs_recurse_xsl:context.PRIMARYKEY" required="yes"/>
- <xsl:param name="debug.last_wfs_request" required="yes"/>
- <xsl:apply-templates mode="#current">
- <xsl:with-param name="p5:links.recurse_level" select="$p5:links.recurse_level"/>
- <xsl:with-param name="p5:links.next.recurse_level" select="$p5:links.next.recurse_level"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
- <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
- <xsl:with-param name="debug.last_wfs_request" select="$debug.last_wfs_request"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!--<xsl:template match="RelatedFeature" mode="get_wfs_recurse_xsl:wfs_response">
- <xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>
- <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response">
- <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
- </xsl:apply-templates>
- </xsl:template>-->
-
- <!--<xsl:template match="simpleTypeMakeOgcFilter|RelatedFilter" mode="get_wfs_recurse_xsl:wfs_response"/>-->
-
- <!--<xsl:template match="*" mode="get_wfs_recurse_xsl:wfs_response">
- <xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>
- <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_simpleType" select="$get_wfs_recurse_xsl:wfs_response"/>
- <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeature">
- <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
- </xsl:apply-templates>
- </xsl:template>-->
-
-
-
-
-
- <xsl:template mode="get_wfs_recurse_xsl:wfs_response_RelatedFeature" match="RelatedFeature">
- <!--<xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>-->
- <xsl:param name="get_wfs_recurse_xsl:typeNameRealResource" select="@typeNameRealResource"/>
- <xsl:param name="input_obj_with_xpath" required="yes"/>
- <xsl:param name="resolveDepth.current" required="yes"/>
- <!--<xsl:param name="xpath" select="$xpath"/>-->
- <!--<xsl:param name="xpath_value" select="$xpath_value"/>-->
- <!--<xsl:variable name="input_obj_with_xpath">
- <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-\- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -\->
- </xsl:variable>-->
- <xsl:choose>
- <xsl:when test="@typeNameRealResource"/>
- <xsl:otherwise><xsl:message terminate="yes">#1174 NOT SET @typeNameRealResource at <xsl:value-of select="name()"/>; </xsl:message></xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$debug > 4"><xsl:message>#1172 @typeNameRealResource = <xsl:value-of select="@typeNameRealResource"/> = Set to $get_wfs_recurse_xsl:typeNameRealResource</xsl:message></xsl:if>
- <xsl:variable name="xpath_dita" select="get_wfs_recurse_xsl:xpath_dita('',@xpath)"/>
- <xsl:variable name="xpath_value_dita" select="get_wfs_recurse_xsl:xpath_value_dita(@xpath,@xpath_value,$input_obj_with_xpath)"/>
- <!--<xsl:variable name="get_wfs_recurse_xsl:GetsimpleSchema" select="get_wfs_recurse_xsl:GetsimpleSchema($typeName)"/>-->
- <xsl:variable name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
- <xsl:variable name="get_wfs_recurse_xsl:RelatedFilter" select="RelatedFilter"/>
- <xsl:variable name="OGC_Filter">
- <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
- <xsl:with-param name="simpleTypeMakeOgcFilter" select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
- <xsl:with-param name="RelatedFilter" select="$get_wfs_recurse_xsl:RelatedFilter"/>
- <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
- <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
- <!-- <xsl:with-param name="get_wfs_recurse_xsl:xpath_dita" select="$xpath_dita"/>
- <xsl:with-param name="get_wfs_recurse_xsl:xpath_value_dita" select="$xpath_value_dita"/>-->
- </xsl:call-template>
- </xsl:variable>
-
- <!--<input_obj_with_xpath><xsl:copy-of select="$input_obj_with_xpath"/></input_obj_with_xpath>-->
- <xsl:if test="$debug > 4">
- <xpath_dita>
- <xsl:value-of select="$xpath_dita"/>/@xpath_value: <xsl:value-of select="@xpath_value"/>
- </xpath_dita>
- <xpath_value_dita>
- <xsl:value-of select="$xpath_value_dita"></xsl:value-of>
- </xpath_value_dita>
- <!-- <get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
- <xsl:copy-of select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
- </get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
- <Filter>
- <xsl:copy-of select="$OGC_Filter"/>
- </Filter>-->
- </xsl:if>
- <!--<xsl:variable name="request_string" select="concat('?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&SRSNAME=EPSG:3003')"/>--> <!-- &MAXFEATURES=15 -->
- <xsl:variable name="request_string">
- <xsl:call-template name="get_wfs_recurse_xsl:request_string">
- <xsl:with-param name="OGC_Filter" select="$OGC_Filter"/>
- <xsl:with-param name="REQUEST.TYPE" select="'GetFeature'"/>
- <xsl:with-param name="REQUEST.TYPENAME" select="$get_wfs_recurse_xsl:typeNameRealResource"/>
- </xsl:call-template>
- </xsl:variable>
- <!--<xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>-->
- <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($request_string)"/>
- <xsl:if test="$debug > 5">
- <wfs_response>
- <request>Retrieving <xsl:value-of select="$request_string"/></request>
- <oryg>https:// biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:CRM_PROCES&SRSNAME=EPSG:3003&MAXFEATURES=15</oryg>
- <test>https://a.binder:@biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:PROCES_INIT&SRSNAME=EPSG:3003&MAXFEATURES=15</test>
- <xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response//gml:featureMember[1]"/>
- </wfs_response>
- </xsl:if>
- <xsl:apply-templates mode="after_first_ant_assing_vars" select="." >
-
- <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
- <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
- </xsl:apply-templates>
-
- </xsl:template>
-
-
- <xsl:template mode="get_wfs_recurse_xsl:wfs_response_RelatedFeatureLoop" match="RelatedFeature">
- <!--<xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>-->
- <xsl:param name="get_wfs_recurse_xsl:typeNameRealResource" select="@typeNameRealResource"/>
- <xsl:param name="input_obj_with_xpath" required="yes"/>
- <xsl:param name="xpath" select="$xpath"/>
- <xsl:param name="xpath_value" select="$xpath_value"/>
- <xsl:param name="resolveDepth.current" required="yes"/>
- <!--<xsl:variable name="input_obj_with_xpath">
- <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-\- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -\->
- </xsl:variable>-->
- <xsl:variable name="xpath_dita" select="get_wfs_recurse_xsl:xpath_dita('',$xpath)"/>
- <xsl:variable name="xpath_value_dita" select="get_wfs_recurse_xsl:xpath_value_dita($xpath,$xpath_value,$input_obj_with_xpath)"/>
- <!--<xsl:variable name="get_wfs_recurse_xsl:GetsimpleSchema" select="get_wfs_recurse_xsl:GetsimpleSchema($typeName)"/>-->
- <xsl:variable name="get_wfs_recurse_xsl:simpleTypeMakeOgcFilter" select="simpleTypeMakeOgcFilter"/>
- <xsl:variable name="get_wfs_recurse_xsl:RelatedFilter" select="RelatedFilter"/>
- <xsl:variable name="OGC_Filter">
- <xsl:call-template name="simpleTypeMakeOgcFilter_merge">
- <xsl:with-param name="simpleTypeMakeOgcFilter" select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
- <xsl:with-param name="RelatedFilter" select="$get_wfs_recurse_xsl:RelatedFilter"/>
-
- <xsl:with-param name="xpath_dita" select="$xpath_dita"/>
- <xsl:with-param name="xpath_value_dita" select="$xpath_value_dita"/>
-
- <!-- <xsl:with-param name="get_wfs_recurse_xsl:xpath_dita" select="$xpath_dita"/>
- <xsl:with-param name="get_wfs_recurse_xsl:xpath_value_dita" select="$xpath_value_dita"/>-->
- </xsl:call-template>
- </xsl:variable>
-
- <!--<input_obj_with_xpath><xsl:copy-of select="$input_obj_with_xpath"/></input_obj_with_xpath>-->
- <xsl:if test="$debug > 4">
- <debug>
- <xsl:attribute name="typeNameRealResource" select="@typeNameRealResource"/>
- <xsl:attribute name="typeName" select="@typeName"/>
- <xpath_dita>
- <xsl:value-of select="$xpath_dita"/>/@xpath_value: <xsl:value-of select="@xpath_value"/>
- </xpath_dita>
- <xpath_value_dita>
- <xsl:value-of select="$xpath_value_dita"></xsl:value-of>
- </xpath_value_dita>
- </debug>
- </xsl:if>
- <!-- <get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
- <xsl:copy-of select="$get_wfs_recurse_xsl:simpleTypeMakeOgcFilter"/>
- </get_wfs_recurse_xsl:simpleTypeMakeOgcFilter>
- <Filter>
- <xsl:copy-of select="$OGC_Filter"/>
- </Filter>-->
-
- <!--<xsl:variable name="request_string" select="concat('?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=',$get_wfs_recurse_xsl:typeNameRealResource,$OGC_Filter,'&SRSNAME=EPSG:3003')"/>--> <!-- &MAXFEATURES=15 -->
- <xsl:variable name="request_string">
- <xsl:call-template name="get_wfs_recurse_xsl:request_string">
- <xsl:with-param name="OGC_Filter" select="$OGC_Filter"/>
- <xsl:with-param name="REQUEST.TYPE" select="'GetFeature'"/>
- <xsl:with-param name="REQUEST.TYPENAME" select="$get_wfs_recurse_xsl:typeNameRealResource"/>
- </xsl:call-template>
- </xsl:variable>
- <!--<xsl:variable name="url_string" select="concat($protocol,$username,':',$username.pass,'@',$api,'/',$targetNamespace_DEFAULTS_prefix,'/',$request_string)"/>-->
- <xsl:variable name="get_wfs_recurse_xsl:wfs_response" select="doc($request_string)"/>
- <xsl:if test="$debug > 4">
- <wfs_response>
- <request>Retrieving <xsl:value-of select="$request_string"/></request>
- <oryg>https:// biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:CRM_PROCES&SRSNAME=EPSG:3003&MAXFEATURES=15</oryg>
- <test>https://a.binder:@biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:PROCES_INIT&SRSNAME=EPSG:3003&MAXFEATURES=15</test>
- <!-- <debug_child_loop>-->
- <!--<xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>-->
- <!--</debug_child_loop>-->
- <!--<xsl:copy-of select="$get_wfs_recurse_xsl:wfs_response"/>-->
- </wfs_response>
- </xsl:if>
- <xsl:apply-templates mode="after_first_ant_assing_vars" select="." >
- <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
- <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <xsl:template mode="get_wfs_recurse_xsl:wfs_response_simpleType" match="*">
- <xsl:copy-of select="."/>
- </xsl:template>
-
-
-
-
-
-
-
-
-
-
- <xsl:template match="wfs:FeatureCollection">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="gml:featureMember">
- <xsl:apply-templates mode="gml:featureMember"/>
- </xsl:template>
-
- <xsl:template match="*" mode="gml:featureMember">
- <!-- TODO parse from prefx requested type -->
- </xsl:template>
-
-
-
-
-
-
- <!-- xpath -->
-
- <xsl:template match="text()|comment()" mode="after_first_ant_assing_vars"/>
-
-
- <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
- <xsl:param name="loop_xpath" />
- <xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>
- <xsl:param name="resolveDepth.current" required="yes"/>
- <!--<RelatedFeatureRoot>-->
-
- <!-- first assign xpath to features from -->
- <xsl:variable name="wfs_output_nodes" select="$get_wfs_recurse_xsl:wfs_response"/>
- <xsl:variable name="current_RelatedFeature" select="*"/>
- <xsl:variable name="xml_id" select="@xml_id"/>
- <xsl:variable name="feature_pos_parent" select="@feature_pos"/>
-
- <xsl:if test="$debug > 2"><xsl:message>
- {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} #354 count($wfs_output_nodes//gml:featureMember) <xsl:value-of select="count($wfs_output_nodes//gml:featureMember)"/></xsl:message></xsl:if>
- <!-- tutaj jest blad przetwarzania ze wrzuca po rekordzie do kolumny - trzeba przetworzyc dla kazdego feature member -->
- <xsl:for-each select="$wfs_output_nodes//gml:featureMember">
- <!--<wfs_record>
- <xsl:copy-of select="."/>
- </wfs_record>-->
- <xsl:variable name="input_obj_with_xpath">
- <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -->
- </xsl:variable>
- <xsl:variable name="input_obj_fid" select="*"/> <!-- dla wykrycia @fid -->
- <xsl:apply-templates mode="after_first_ant_assing_vars_childs" select="$current_RelatedFeature">
- <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
- <xsl:with-param name="xml_id_parent" select="$xml_id"/>
- <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
- <xsl:with-param name="feature_pos" select="position()"/><!-- wiecej features z relacji dokladamy pozycje -->
- <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 -->
- <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
- <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
- </xsl:apply-templates>
- <!-- cache tasks ? -->
- </xsl:for-each>
- <!--</RelatedFeatureRoot>-->
- </xsl:template>
-
-
-
-
-
- <!--<xsl:template match="wfs:FeatureCollection|gml:featureMember" mode="after_first_ant_assing_xpath">
- <xsl:apply-templates mode="after_first_ant_assing_xpath"/>
- </xsl:template>-->
-
-
- <xsl:template mode="after_first_ant_assing_xpath" match="*">
- <xsl:param name="curr_xpath"/>
- <xsl:param name="loop_xpath"/>
- <xsl:choose>
- <xsl:when test="name()=$typeName">
- <xsl:apply-templates mode="after_first_ant_assing_xpath">
- <xsl:with-param name="curr_xpath" select="$curr_xpath"/>
- <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="curr_xpath_tmpl">
- <xsl:choose>
- <xsl:when test="$curr_xpath=''">
- <xsl:value-of select="local-name()"/> <!-- bylo local-name() - trzeba dorzucic xpath przechodzacy aby budowal sie w kwestii -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($curr_xpath,'/',local-name())"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--<xsl:variable name="curr_xpath_tmpl" select="'asdf'"/>-->
- <!--<xsl:element name="{name()}" >-->
-
- <xsl:choose>
- <xsl:when test="contains(name(),'gml')">
- <xsl:element name="{local-name()}">
- <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
- <xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="name()='fid'"/>
- <xsl:otherwise><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:value-of select="text()"/>
- <xsl:apply-templates mode="after_first_ant_assing_xpath">
- <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
- <xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="name()='fid'"/>
- <xsl:otherwise><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:value-of select="text()"/>
- <xsl:apply-templates mode="after_first_ant_assing_xpath">
- <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
-
-
- <!--</xsl:element>-->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text()" mode="after_first_ant_assing_xpath"/>
-
-
- <xsl:template match="simpleTypeMakeOgcFilter" mode="after_first_ant_assing_vars_childs">
- <xsl:if test="$debug > 2"><xsl:message>#621 bypassing simpleTypeMakeOgcFilter in after_first_ant_assing_vars_childs</xsl:message></xsl:if>
- </xsl:template>
-
-
- <!-- przetwarzanie kolejne w celu podstawienia wartosci i wystawienia build dla kolejnych wezlow - problem z obsluga rownorzednie zagniezdzonych wezlow poprzez inne wezly -->
- <xsl:template match="*" mode="after_first_ant_assing_vars_childs">
- <xsl:param name="xml_id_parent" required="yes"/>
- <xsl:param name="loop_xpath" required="yes"/>
- <xsl:param name="input_obj_with_xpath" required="yes"/>
- <xsl:param name="feature_pos" required="yes"/>
- <xsl:param name="feature_pos_parent" required="yes"/>
- <xsl:param name="input_obj_fid" required="no"/>
- <xsl:param name="resolveDepth.current" required="yes"/>
- <xsl:for-each select=".">
- <xsl:choose>
-
- <xsl:when test="1=2"/>
- <xsl:otherwise>
- <xsl:element name="{local-name()}">
-
- <!--<xsl:if test="$input_obj_fid">
- <!-\-<xsl:attribute name="input_obj_fid_name" select="$input_obj_fid/name()"/>-\->
- <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>
- </xsl:if>-->
- <!--<xsl:copy-of select="namespace::node()"/>-->
- <xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="name()='fid'"/>
- <xsl:when test="name()='xml_id'"/>
- <xsl:when test="name()='format'"/>
- <xsl:when test="name()='xpath_token_filter'"/>
- <xsl:when test="name()='xpath_token'"/>
- <xsl:when test="name()='xpath'">
- <!--<xsl:attribute name="xpath_parsed" select="."/>-->
- <!--1:<xsl:value-of select="$parent_obj//node()[@system_cache__appinfo:xpath=$xpath]/text()"/>-->
- <!--<xsl:value-of select="$parent_obj//node()[local-name()=$xpath]/text()"/>-->
- <!--V:<xsl:value-of select="$xpath"/>-->
- </xsl:when>
- <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@xpath">
- <!--<xsl:variable name="enter_to_ph">-->
- <xsl:choose>
- <xsl:when test="@xpath_token_filter and @xpath_token ">
- <!-- implementacja filtra dla czegos oddzielonego parametrem -->
- <xsl:variable name="xpath_token_filter" select="tokenize($input_obj_with_xpath/node()[local-name()=current()/@xpath],@xpath_token_filter)"/>
- <xsl:for-each select=" tokenize(@xpath_token,' ')">
- <xsl:variable name="xpath_token" select="number(.)"/>
- <xsl:copy-of select="$xpath_token_filter[$xpath_token]"></xsl:copy-of>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/*">
- <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/*"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <!--TODO <xsl:when test="@format = 'enter_to_ph'">
- <xsl:variable name="node">
- <xsl:element name="{name()}">
- <xsl:copy-of select="."/>
- </xsl:element>
- </xsl:variable>
- <xsl:variable name="enter_to_ph">
- <xsl:apply-templates mode="enter_to_ph" select="$node">
- <xsl:with-param name="count" select="count(.)"/>
- <xsl:with-param name="element" select="name()"/>
- <!-\-<xsl:with-param name="xpath_token_filter" select="@xpath_token_filter"/>-\-><!-\- mozliwosc wybrania pierwszego wyrazu np ' ' -\->
- <!-\-<xsl:with-param name="xpath_token" select="@xpath_token"/>-\-><!-\- mozliwosc wybrania pierwszego wyrazu np 1 -\->
- </xsl:apply-templates>
- </xsl:variable>
- <formated>
- <node>
- <xsl:copy-of select="$node"/>
- </node>
- <xsl:copy-of select="$enter_to_ph" copy-namespaces="no"/>
- </formated>
- </xsl:when>-->
- <xsl:when test="@format = 'enter_to_ph'">
- <xsl:variable name="node">
- <xsl:element name="{name()}">
- <xsl:copy-of select="."/>
- </xsl:element>
- </xsl:variable>
- <xsl:variable name="node-name" select="local-name()"/>
- <xsl:variable name="node-count" select="count(../*[ local-name() = $node-name])"/>
- <xsl:message>#1562 TODO @format = 'enter_to_ph' ; element=<xsl:value-of select="name()"/>; count()=<xsl:value-of select="$node-count"/> ; </xsl:message>
- <xsl:variable name="node-set">
- <xsl:element name="{$node-name}">
- <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
- </xsl:element>
- </xsl:variable>
- <xsl:variable name="enter_to_ph">
- <xsl:apply-templates mode="enter_to_ph" select="$node-set">
- <xsl:with-param name="count" select="$node-count"/>
- <xsl:with-param name="element" select="$node-name"/>
- <!--<xsl:with-param name="xpath_token_filter" select="@xpath_token_filter"/>--><!-- mozliwosc wybrania pierwszego wyrazu np ' ' -->
- <!--<xsl:with-param name="xpath_token" select="@xpath_token"/>--><!-- mozliwosc wybrania pierwszego wyrazu np 1 -->
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:copy-of select="$enter_to_ph" copy-namespaces="no"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]/text()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <!--</xsl:variable>-->
- <!--<xsl:copy-of select="$enter_to_ph"/>-->
- </xsl:when>
- <xsl:otherwise><xsl:copy-of select="text()"></xsl:copy-of></xsl:otherwise>
- </xsl:choose>
- <!--<xsl:comment>#1938 value of text()</xsl:comment>-->
- <!--XXXX <xsl:value-of select="text()"/>-->
- <xsl:apply-templates mode="after_first_ant_assing_vars_childs">
- <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
- <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
- <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
- <xsl:with-param name="feature_pos" select="$feature_pos"/>
- <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
- <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
- <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars_childs">
- <xsl:if test="$debug > 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>
- </xsl:template> <!-- to disable ignored maxOccurs=0 -->
-
- <xsl:template match="RelatedFeature[not(@system_cache__appinfo:maxOccurs='0') or not($ignore_maxOccurs_0)]" mode="after_first_ant_assing_vars_childs">
- <xsl:param name="input_obj_with_xpath" required="yes"/>
- <xsl:param name="xml_id_parent" required="yes"/>
- <xsl:param name="loop_xpath" />
- <xsl:param name="feature_pos" required="yes"/>
- <xsl:param name="feature_pos_parent" required="yes"/>
- <xsl:param name="input_obj_fid" required="yes"/>
- <xsl:param name="xpath_query"/> <!-- + added test -->
- <xsl:param name="resolveDepth.current" required="yes"/>
- <xsl:if test="$debug > 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>
- <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
- <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
- <xsl:variable name="xml_id" select="@xml_id"/>
- <xsl:variable name="loop_xpath" select="concat($loop_xpath,'/',$xml_id,'.',$feature_pos)"/> <!-- loop path too long ,'.',$featureID_name -->
- <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
- <!--<debug_358_RelatedFeature>
- <xsl:copy-of select="$input_obj_with_xpath"/>
- </debug_358_RelatedFeature>-->
- <!--<xsl:variable name="feature_pos">
- <xsl:choose>
- <xsl:when test="$feature_pos=1"/>
- <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>-->
- <xsl:variable name="test_xpath_query">
- <xsl:call-template name="test_xpath_query">
- <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
- <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
- <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
- <xsl:with-param name="xpath_query" select="$xpath_query"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$test_xpath_query='1'">
- <xsl:if test="$debug > 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>
- <xsl:comment>#527 there we exec child dig</xsl:comment>
- <!-- <xsl:element name="RelatedFeature">
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="featureID_name" select="$featureID_name"/>
- <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
- <xsl:attribute name="feature_pos" select="$feature_pos"/>
- <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/>
- <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>-->
- <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeature" select=".">
- <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
- <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
- </xsl:apply-templates>
- <!--</xsl:element>-->
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$debug > 2"><xsl:message terminate="no">#389b
- #
- #
- #
- 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
- #
- #</xsl:message></xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
- <xsl:template match="RelatedFeatureLoop" mode="after_first_ant_assing_vars_childs">
- <xsl:if test="$debug > 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>
- </xsl:template>
- <xsl:template match="RelatedFeatureLoop[not(@system_cache__appinfo:maxOccurs='0') or not($ignore_maxOccurs_0)]" mode="after_first_ant_assing_vars_childs">
- <xsl:param name="input_obj_with_xpath" required="yes"/>
- <xsl:param name="xml_id_parent" required="yes"/>
- <xsl:param name="loop_xpath" />
- <xsl:param name="feature_pos" required="yes"/>
- <xsl:param name="feature_pos_parent" required="yes"/>
- <xsl:param name="input_obj_fid" required="yes"/>
- <xsl:param name="xpath_query"/> <!-- + added test -->
- <xsl:param name="resolveDepth.current" required="yes"/>
- <xsl:if test="$debug > 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>
- <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
- <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
- <xsl:variable name="xml_id" select="@xml_id"/>
- <xsl:variable name="loop_xpath" select="concat($loop_xpath,'/',$xml_id,'.',$feature_pos)"/> <!-- loop path too long ,'.',$featureID_name -->
- <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
- <!--<debug_358_RelatedFeature>
- <xsl:copy-of select="$input_obj_with_xpath"/>
- </debug_358_RelatedFeature>-->
- <!--<xsl:variable name="feature_pos">
- <xsl:choose>
- <xsl:when test="$feature_pos=1"/>
- <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>-->
- <xsl:variable name="test_xpath_query">
- <xsl:call-template name="test_xpath_query">
- <xsl:with-param name="featureID_name_dita" select="$featureID_name"/>
- <xsl:with-param name="ignore_maxOccurs_0" select="$ignore_maxOccurs_0"/>
- <xsl:with-param name="system_cache__appinfo:maxOccurs" select="@system_cache__appinfo:maxOccurs"/>
- <xsl:with-param name="xpath_query" select="$xpath_query"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$resolveDepth.current > $resolveDepth">
- <xsl:message>#1722 exceeded $resolveDepth.current > $resolveDepth = <xsl:value-of select="$resolveDepth.current"/></xsl:message>
- </xsl:when>
- <xsl:when test="$test_xpath_query='1'">
- <xsl:if test="$debug > 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>
- <xsl:comment>#527 there we exec child dig</xsl:comment>
- <!-- <xsl:element name="RelatedFeature">
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="featureID_name" select="$featureID_name"/>
- <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
- <xsl:attribute name="feature_pos" select="$feature_pos"/>
- <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/>
- <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>-->
- <xsl:comment>#710 opening new Loop recurse instance for <xsl:value-of select="@typeName"/></xsl:comment>
- <xsl:message>#710 resolveDepth.current = <xsl:value-of select="$resolveDepth.current"/>; opening new Loop recurse instance for <xsl:value-of select="@typeName"/></xsl:message>
- <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeatureLoop" select="get_wfs_recurse_xsl:GetsimpleSchema(@typeName)">
- <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
- <xsl:with-param name="xpath" select="@xpath"/>
- <xsl:with-param name="xpath_value" select="@xpath_value"/>
- <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current + 1"/>
- </xsl:apply-templates>
- <!--</xsl:element>-->
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$debug > 2"><xsl:message terminate="yes">#389b
- #
- #
- #
- 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
- #
- #</xsl:message></xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
- <xsl:template match="text()" mode="after_first_ant_assing_vars_childs"/>
- <xsl:template match="comment()" mode="after_first_ant_assing_vars_childs"/>
- <!-- pozbieranie do kupy wszystkich xmli i zlozenie dity -->
-
- <xsl:template name="test_xpath_query">
- <!-- to verify if retrieve some node based on user requested tree limit filter -->
- <xsl:param name="ignore_maxOccurs_0" required="yes"/>
- <xsl:param name="xpath_query" required="yes"/>
- <xsl:param name="featureID_name_dita" required="yes"/>
- <xsl:param name="system_cache__appinfo:maxOccurs" required="yes"/>
- <xsl:if test="$debug > 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>
- <xsl:if test="$ignore_maxOccurs_0"><xsl:if test="$debug > 2"><xsl:message terminate="no">#1344 test igrnore is true()=<xsl:value-of select="$ignore_maxOccurs_0"/>;</xsl:message></xsl:if></xsl:if>
- <xsl:variable name="TestMaxOccurs">
- <xsl:choose>
- <xsl:when test="$system_cache__appinfo:maxOccurs='0' and $ignore_maxOccurs_0"></xsl:when>
- <xsl:otherwise><xsl:value-of select="1"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$TestMaxOccurs"/>
- </xsl:template>
-
- <xsl:template match="RelatedFeatureRoot" mode="anonimize_for_devel">
- <wfs:FeatureCollection>
- <xsl:apply-templates mode="anonimize_for_devel.featureMember" />
- </wfs:FeatureCollection>
- </xsl:template>
-
-
- <xsl:template match="*" mode="anonimize_for_devel.featureMember">
- <gml:featureMember>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="anonimize_for_devel.child"/>
- </xsl:copy>
- </gml:featureMember>
- </xsl:template>
-
-
-
- <xsl:template match="p5:links" mode="anonimize_for_devel.child"/>
- <xsl:template match="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI[ parent::default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA]|default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY[ parent::default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA]" priority="9" mode="anonimize_for_devel.child">
- <xsl:message>#1600 debug hidden name()=<xsl:value-of select="name()"/>;</xsl:message>
- </xsl:template>
-
-
- <xsl:template match="get_wfs_recurse_xsl:context.PRIMARYKEY|get_wfs_recurse_xsl:context.nodes" mode="anonimize_for_devel.child"/>
- <xsl:template match="text()" mode="anonimize_for_devel.child"/>
-
- <xsl:template match="comment()" mode="anonimize_for_devel.child">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template match="*" mode="anonimize_for_devel.child">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="text()"/>
- <xsl:apply-templates mode="#current"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="*[ local-name()='krs' or local-name()='pesel' or local-name()='nazwa' or local-name()='nazwisko' or local-name()='NIP' or local-name()='REGON' or local-name()='KRS' or local-name()='Pelna_nazwa_kontrahenta' or
- local-name()='Ulica' or local-name()='Miejscowosc' or local-name()='Kod_pocztowy' or local-name()='TERYT_SYM_UL' or local-name()='TERYT_SYM' or local-name()='Numer_budynku']" mode="anonimize_for_devel.child">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:value-of select="concat(substring(text(),1,2),'*****',string-length(text()))"/>
- </xsl:copy>
- </xsl:template>
-
-
-
-
-
-
- </xsl:stylesheet>
|