p5_tr_map.xsl 224 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
  4. xmlns:p5_tr_map_js="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map_js.xsd"
  5. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  6. xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  7. xmlns:exslt="http://exslt.org/common"
  8. xmlns:dyn="http://saxon.sf.net/"
  9. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  10. xmlns:TERYT_terc_xml_import_after_main="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/TERYT_terc_xml_import_after_main.xsd"
  11. xmlns:default_default_objects_types="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/default_objects_types.xsd"
  12. xmlns:default_db="http://biuro.biall-net.pl/xmlschema_procesy5/default_db"
  13. xmlns:default_projects="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/projects.xsd"
  14. xmlns:default_db_CRM_WSKAZNIK="http://biuro.biall-net.pl/xmlschema_procesy5/default_db/CRM_WSKAZNIK"
  15. xmlns:default_infrastructure_buildings="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/infrastructure_buildings.xsd"
  16. xmlns:default_workers="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/workers.xsd"
  17. xmlns:bpmn20="http://www.omg.org/spec/BPMN/20100524/MODEL"
  18. xmlns:database_objects="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/database_objects.xsd"
  19. xmlns:system_cache__procesy5_xsd_business_objects="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/procesy5_xsd_business_objects.xsd"
  20. xmlns:default_crm_proces="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/crm_proces.xsd"
  21. xmlns:teryt="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/teryt.xsd"
  22. xmlns:default_db_TELBOXES="http://biuro.biall-net.pl/xmlschema_procesy5/default_db/TELBOXES"
  23. xmlns:graph_relation_elements="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/graph_relation_elements.xsd"
  24. xmlns:default_corespondence="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/corespondence.xsd"
  25. xmlns:default_db_CRM_LISTA_ZASOBOW="http://biuro.biall-net.pl/xmlschema_procesy5/default_db/CRM_LISTA_ZASOBOW"
  26. xmlns:default_db_BUILDINGS="http://biuro.biall-net.pl/xmlschema_procesy5/default_db/BUILDINGS"
  27. xmlns:default_db_DEVICES="http://biuro.biall-net.pl/xmlschema_procesy5/default_db/DEVICES"
  28. xmlns:default_recurring_accounting_features="http://biuro.biall-net.pl/xmlschema_procesy5/default_objects/recurring_accounting_features.xsd"
  29. xmlns:system_cache__filesystem="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/filesystem.xsd"
  30. xmlns:gml="http://www.opengis.net/gml/3.2"
  31. xmlns:xlink="http://www.w3.org/1999/xlink"
  32. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  33. 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"
  34. xmlns:p5="https://biuro.biall-net.pl/wfs"
  35. exclude-result-prefixes="xs dyn exslt"
  36. version="2.0">
  37. <!-- @2015-11-19 - PRZERABIANY I CZYSZCZONY XSL NA BAZIE crm_lista_zasobow_to_xml_tree_instances.xsl z funkcjami wylacznie do schematu p5_tr_map.xsd
  38. XSL do stworzenia instancji XML na podstawie ktorego system bedzie mozliwa analiza jakie typy zasobow w jakich tabelach
  39. sa ze soba powiazane aby wyszukiwac ich instancji w tabelach dla danych typow obiektow
  40. - buduje drzewo zasobow
  41. - sprawdza czy dany typ zasobu jako schemat XSD TYPE moze miec pod soba inny zasob jako child
  42. - sprawdza czy jest taki typ zasobu w relacji XSD opisany (dla standardowych przypadkow dzial/magazyn/urzadzenie)
  43. - sprawdza czy jest taki typ zasobu w relacji XSD opisany jako substitution_group (dla przypadku stanowisko/magazyn)
  44. - dla kazdego z typow zasobow na podstawie TYPE odczytuje jaki jest to typ zasobu pierwotnego z DEFAULT_OBJECTS_TYPES i
  45. szuka w powiaznej tabeli instancyjnej dla danego typu wpisow instancyjnych dla danego miejsca w aktualnym XPATH danego zagłębienia obiektu.
  46. - jest w stanie stwierdzic czy dane obiekty istnieją w fizycznie, czego brakuje, czego jest za duzo...
  47. - mozna wygenerowac informacje o tym czego brakuje - wpisy na waitingu.
  48. ( jezeli obiekty beda uzywane zgodne ze schematami XSD to ich relacje z CRM_XPATH_TREE beda mozliwe do powtorzenia w ich natywnych relacjach)
  49. -->
  50. <!--<xsl:import href="../default_db_xml_cache.public/import_resource_table_xml_from_api.xsl"/>-->
  51. <!--<xsl:import href="replace_xml_elements_in_xml.xsl"/>-->
  52. <!--<xsl:import href="get_all_xsd.xsl"/>-->
  53. <xsl:import href="../default_db_xml_cache/build_complexType.xsl"/>
  54. <!-- @2015-05-02 template do wgrania obiektu z planu $system_cache__appinfo:save_to_api_xml problematyka @evaluate_key_value oraz @read_key_value
  55. musi jechac raz z gory raz z dolu, az wszystkie read_key_value zostana wypelnione aby moc wypelnic evaluate_key_value
  56. powinien robic mape do ewentualnej kompensacji -->
  57. <!--<xsl:import href="system_cache_appinfo-save_to_api_xml_save.xsl"/>-->
  58. <xsl:import href="form_occurs_max_sequence.xsl"/>
  59. <xsl:param name="debug_level_param"/>
  60. <xsl:param name="default_db.instance.xml" required="yes"/>
  61. <xsl:param name="default_db.instance.xml.symlink" required="yes"/>
  62. <xsl:param name="vrtfNamespaces_file" required="yes"/> <!--/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/default_db.instance.xml/transformed/vrtfNamespaces.xml-->
  63. <xsl:param name="procesy5_system_schema_file" required="yes"/> <!--/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/default_db.instance.xml/transformed/procesy5_system_schema.xml-->
  64. <xsl:param name="parent_type"/> <!-- used from ant xsl direct call / error when global! -->
  65. <xsl:variable name="vrtfNamespaces" select="doc($vrtfNamespaces_file)/system_cache__appinfo:vrtfNamespaces/*"/>
  66. <xsl:variable name="procesy5_system_schema" select="doc($procesy5_system_schema_file)"/>
  67. <xsl:param name="p5_tr_map:targetNamespaces_for_4777_list"><!-- okreslenie jakie targetNamespaces ze schematow w przypadku @ref, maja byc integrowane z instancja elementu bazowego i traktowane jako @event_type='4777'-->
  68. <p5_tr_map:targetNamespaces_for_4777_list>
  69. <p5_tr_map:targetNamespaces_for_4777>http://biuro.biall-net.pl/xmlschema_procesy5/default_db</p5_tr_map:targetNamespaces_for_4777>
  70. <!-- <p5_tr_map:targetNamespaces_for_4777>https://biuro.biall-net.pl/wfs/default_db/table/CRM_WSKAZNIK.xsd</p5_tr_map:targetNamespaces_for_4777>
  71. <p5_tr_map:targetNamespaces_for_4777>https://biuro.biall-net.pl/wfs/default_db/table/CRM_PROCES.xsd</p5_tr_map:targetNamespaces_for_4777>
  72. <p5_tr_map:targetNamespaces_for_4777>https://biuro.biall-net.pl/wfs/default_db/table/CRM_LISTA_ZASOBOW.xsd</p5_tr_map:targetNamespaces_for_4777>-->
  73. </p5_tr_map:targetNamespaces_for_4777_list>
  74. </xsl:param>
  75. <xsl:variable name="debug_level">
  76. <xsl:choose>
  77. <xsl:when test="$debug_level_param"><xsl:value-of select="$debug_level_param"/></xsl:when>
  78. <xsl:otherwise>0</xsl:otherwise>
  79. </xsl:choose>
  80. </xsl:variable>
  81. <!--<xsl:variable name="CRM_LISTA_ZASOBOW">
  82. <xsl:call-template name="import_resource_table_xml_from_api">
  83. <xsl:with-param name="cache" select="'read'"/>
  84. <xsl:with-param name="resource" select="'CRM_LISTA_ZASOBOW'"/>
  85. </xsl:call-template>
  86. </xsl:variable>-->
  87. <!--<xsl:variable name="procesy5_system_schema">
  88. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  89. <xsl:with-param name="path2collection" select="'../'"/>
  90. </xsl:call-template>
  91. </xsl:variable>--> <!-- odczytanie schematu bazy danych w XSD -->
  92. <!--<xsl:variable name="vrtfNamespaces">
  93. <xsl:for-each select=
  94. "$procesy5_system_schema//schema/namespace::node()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  95. <ns element="{name(..)}"
  96. prefix="{name()}" uri="{.}"/>
  97. </xsl:for-each>
  98. </xsl:variable>-->
  99. <xsl:template name="main">
  100. <!--<xsl:variable name="element" select="'teryt:Teryt_Adres_Prawidlowy'"/>--> <!-- default_default_objects_types:BUDYNEK test_objects:klient 'infrastructure_buildings:Device' 'test_objects:AAAAA' prove_portal:klient 'prove_portal:event' default_default_objects_types:NARZEDZIE default_accounting:currencies test_objects:klient AAAAAL default_default_objects_types:URZADZENIE -->
  101. <!--<xsl:variable name="element" select="'default_workers:worker'"/>-->
  102. <!--<xsl:variable name="element" select="'teryt:Teryt_Adres_Prawidlowy'"/>-->
  103. <!--<xsl:variable name="element" select="'default_resources_suppliers:resource_supply'"/>-->
  104. <!--<xsl:variable name="element" select="'test_objects:t459-type-derev-el'"/>-->
  105. <!--<xsl:variable name="element" select="'test_objects:t459b-type-el'"/>-->
  106. <!--<xsl:variable name="element" select="'test_objects:t459b-el'"/>-->
  107. <!--<xsl:variable name="element" select="'test_objects:klient'"/>-->
  108. <!--<xsl:variable name="element" select="'default_default_objects_types:URZADZENIE'"/>-->
  109. <xsl:variable name="element" select="'default_db__x3A__CRM_PROCES:CRM_PROCES'"/>
  110. <!--<xsl:variable name="element" select="'default_infrastructure:Obiekt_infrastruktury_PROJEKT'"/>-->
  111. <!--<xsl:variable name="element" select="'TERYT_terc_xml_import_after_main:after_main'"/>-->
  112. <!--<xsl:variable name="element" select="'default_default_objects_types:RESOURCE'"/>-->
  113. <!--<xsl:variable name="element" select="'test_objects:BBA-el'"/>-->
  114. <!--<xsl:variable name="element" select="'restriction-test-for-transformations:BetaEx'"/>-->
  115. <!--<xsl:variable name="element" select="'default_default_objects_types:URZADZENIA_I_OZNACZENIA_BHP'"/>-->
  116. <xsl:variable name="p5_tr_map:go_recurse_from_root_by_build_element">
  117. <xsl:call-template name="p5_tr_map:go_recurse_from_root_by_build_element_cache">
  118. <xsl:with-param name="parent_type" select="$element"/>
  119. <xsl:with-param name="cache" select="'refresh'"/>
  120. </xsl:call-template>
  121. </xsl:variable>
  122. <!--<xsl:variable name="p5_tr_map:go_recurse_from_root_by_build_element">
  123. <xsl:call-template name="p5_tr_map:go_recurse_from_root_by_build_complexType_cache">
  124. <xsl:with-param name="parent_type" select="$element"/>
  125. <xsl:with-param name="cache" select="'refresh'"/>
  126. </xsl:call-template>
  127. </xsl:variable>-->
  128. <xsl:result-document href="{concat('../default_db.instance.xml/p5_tr_map/go_recurse_from_root_by_build_element/',$element,'.xml')}">
  129. <xsl:copy-of select="$p5_tr_map:go_recurse_from_root_by_build_element" copy-namespaces="no"/>
  130. </xsl:result-document>
  131. <!--<xsl:result-document href="{concat('../default_db.instance.xml/p5_tr_map/rebuild_p5_tr_map_file_cache','.xml')}">
  132. <xsl:call-template name="p5_tr_map:rebuild_p5_tr_map_file_cache"/>
  133. </xsl:result-document>-->
  134. </xsl:template>
  135. <xsl:template mode="p5_tr_map:element_complexType_tr_map" match="system_cache__appinfo:element_complexType"> <!-- do hurtowego wygenerowania plaskich obiektow -->
  136. <!-- {http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd}build_complexType -->
  137. <build_tr_map_raport>
  138. <xsl:for-each select="build_cache">
  139. <xsl:element name="{name()}">
  140. <xsl:copy-of select="@*"/>
  141. <xsl:choose>
  142. <xsl:when test="@name='build_complexType'">
  143. <xsl:call-template name="p5_tr_map:go_recurse_from_root_by_build_complexType_cache">
  144. <xsl:with-param name="parent_type" select="with-param/@select"/>
  145. </xsl:call-template>
  146. </xsl:when>
  147. <xsl:when test="@name='build_element'">
  148. <xsl:call-template name="p5_tr_map:go_recurse_from_root_by_build_element_cache">
  149. <xsl:with-param name="parent_type" select="with-param/@select"/>
  150. </xsl:call-template>
  151. </xsl:when>
  152. <xsl:otherwise>
  153. <xsl:message terminate="yes">#308 unexpected @name=<xsl:value-of select="@name"/>;</xsl:message>
  154. </xsl:otherwise>
  155. </xsl:choose>
  156. </xsl:element>
  157. </xsl:for-each>
  158. </build_tr_map_raport>
  159. </xsl:template>
  160. <xsl:template name="p5_tr_map:rebuild_p5_tr_map_file_cache"><!-- @2016-01-26 funkcja do wygenerowania wszystkich aktualnych p5_tr_map oraz build_complexType -->
  161. <xsl:param name="href" select="'../rebuild_p5_tr_map_file_cache.sh'"/>
  162. <xsl:param name="targetNamespace" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db'"/>
  163. <xsl:result-document href="{$href}" omit-xml-declaration="yes">
  164. export SAXON_HOME=/opt/local/share/java/
  165. <xsl:for-each select="$procesy5_system_schema/get_all_xsd_list/get_all_xsd[ substring-before(@system_cache__appinfo:document-uri,'/')!='default_db_xml_cache']" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
  166. <xsl:variable name="get_all_xsd_236" select="."/>
  167. <xsl:for-each select="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!--[ @targetNamespace != $targetNamespace ] namespace::node() = $targetNamespace and @targetNamespace='moj_ogrodek' -->
  168. <xsl:variable name="targetNamespace_134" select="@targetNamespace"/>
  169. <xsl:variable name="prefix_134" select="namespace::node()[. = $targetNamespace_134][1]/name()"/>
  170. #134 jade schema <xsl:value-of select="$targetNamespace_134"/>;
  171. <xsl:choose>
  172. <xsl:when test="count(.//node()[(local-name()='element' or local-name()='complexType' or local-name()='sequence' or local-name()='choice' or local-name()='complexContent' or local-name()='extension' ) and not(@id)])=0">
  173. <xsl:for-each select="(element|complexType)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!-- dla ograniczenia mozna [$prefix_134='test_objects']-->
  174. echo "#135 jade element/complexType <xsl:value-of select="@name"/>;"
  175. <xsl:variable name="complexType_or_element_name186">
  176. <xsl:choose>
  177. <xsl:when test="local-name()='element'"><xsl:value-of select="@name"/></xsl:when>
  178. <xsl:when test="local-name()='complexType'"><xsl:value-of select="@name"/></xsl:when>
  179. <xsl:otherwise><xsl:message terminate="yes">#391 it should work only for element or complexType</xsl:message></xsl:otherwise>
  180. </xsl:choose>
  181. </xsl:variable>
  182. <xsl:choose>
  183. <xsl:when test="local-name()='element'">
  184. <!--<xsl:call-template name="p5_tr_map:go_recurse_from_root_by_build_element_cache">
  185. <xsl:with-param name="parent_type"
  186. select="concat($prefix_134, ':', $complexType_or_element_name186)"/>
  187. <xsl:with-param name="output" select="'disable'"/>
  188. </xsl:call-template>-->
  189. ./../../test-saxon-cmd/saxon-he-with-expath-http-client.sh -xsl:Makefile.xsl -it:go_recurse_from_root_by_build_element_cache parent_type="<xsl:value-of select="concat($prefix_134, ':', $complexType_or_element_name186)"/>"
  190. </xsl:when>
  191. <xsl:when test="local-name()='complexType'">
  192. <!--<xsl:call-template name="p5_tr_map:go_recurse_from_root_by_build_complexType_cache">
  193. <xsl:with-param name="parent_type"
  194. select="concat($prefix_134, ':', $complexType_or_element_name186)"/>
  195. <xsl:with-param name="output" select="'disable'"/>
  196. </xsl:call-template>-->
  197. ./../../test-saxon-cmd/saxon-he-with-expath-http-client.sh -xsl:Makefile.xsl -it:go_recurse_from_root_by_build_complexType_cache parent_type="<xsl:value-of select="concat($prefix_134, ':', $complexType_or_element_name186)"/>"
  198. </xsl:when>
  199. </xsl:choose>
  200. </xsl:for-each>
  201. </xsl:when>
  202. </xsl:choose>
  203. #system_cache__resources_tree_generate_xsl_required_occurs_raport:schema_errors_id_too_long
  204. <xsl:choose>
  205. <xsl:when test=".//node()[ string-length(@id)&gt;64]">
  206. <xsl:message>#571 too long @id values in schema elements:</xsl:message>
  207. <xsl:for-each select=".//node()[ string-length(@id)&gt;64]">
  208. <xsl:message terminate="no">@id=<xsl:value-of select="@id"/>; </xsl:message>
  209. </xsl:for-each>
  210. <xsl:message terminate="yes">- fix this list and restart transformation.</xsl:message>
  211. </xsl:when>
  212. </xsl:choose>
  213. <xsl:choose>
  214. <xsl:when test="@targetNamespace = $targetNamespace"/><!-- pomijamy wykrywanie brakuajacych @id dla schematu default_db - ktory jest obcym systemem plaskim -->
  215. <xsl:when test="count(.//node()[(local-name()='element' or local-name()='complexType' or local-name()='sequence' or local-name()='choice' or local-name()='complexContent' or local-name()='extension' ) and not(@id)])>0">
  216. <xsl:variable name="new-schema-tempfile-name" select="replace($get_all_xsd_236/@system_cache__appinfo:document-uri,'.xsd','.xml')"/>
  217. <xsl:variable name="new-document-uri_with-id" select="concat('../default_db.instance.xml/new-schema-with-ID-to-move-and-rename-to-xsd/',$new-schema-tempfile-name)"/>
  218. #system_cache__resources_tree_generate_xsl_required_occurs_raport:generate_element_id_for_schema
  219. <!--<xsl:attribute name="system_cache__appinfo:document-uri" select="$get_all_xsd_236/@system_cache__appinfo:document-uri"></xsl:attribute>
  220. <xsl:attribute name="system_cache__appinfo:new-document-uri_with-id" select="$new-document-uri_with-id"/>-->
  221. #438: tutaj wygenerowano schemat z @id
  222. <xsl:choose>
  223. <xsl:when test="1=2"/>
  224. <!--<xsl:when test="$get_all_xsd_236/@system_cache__appinfo:document-uri='http://www.w3.org/1999/XSL/Transform'">Schema for </xsl:when>-->
  225. <xsl:otherwise>
  226. <xsl:result-document href="{$new-document-uri_with-id}">
  227. <xsl:apply-templates mode="system_cache__resources_tree_generate_xsl_required_occurs_raport:generate_element_id_for_schema" select="$get_all_xsd_236"/>
  228. </xsl:result-document>
  229. </xsl:otherwise>
  230. </xsl:choose>
  231. #/system_cache__resources_tree_generate_xsl_required_occurs_raport:generate_element_id_for_schema
  232. </xsl:when>
  233. </xsl:choose>
  234. </xsl:for-each>
  235. </xsl:for-each>
  236. </xsl:result-document>
  237. </xsl:template>
  238. <xsl:template name="p5_tr_map:go_recurse_from_root_by_build_element">
  239. <!-- template @2015-04-23 do złożenia obiektu xml na podstawie wygenerowanego wypłaszczonego rekursywnie schematu -->
  240. <xsl:param name="element"/> <!-- nazwa instancyjnego obiektu do wyszukania -->
  241. <xsl:param name="INSTANCE_ID"/> <!-- numer ID obiektu do znalezienia-->
  242. <xsl:if test="$debug_level>3"><xsl:message>122 tworze wyplaszczony schemat dla elementu</xsl:message></xsl:if>
  243. <xsl:variable name="schema_build_element"><!-- budujemy schemat dla elementu do parsowania-->
  244. <xsl:call-template name="system_cache__appinfo:build_element">
  245. <xsl:with-param name="element" select="$element"/>
  246. </xsl:call-template>
  247. </xsl:variable>
  248. <!--<xsl:result-document href="../default_db.instance.xml/schema_build_element.xml">
  249. <xsl:copy-of select="$schema_build_element"/>
  250. </xsl:result-document>-->
  251. <xsl:message>132 tworze mape przetwarzania obiektu go_recurse_from_root_by_build_element</xsl:message>
  252. <xsl:variable name="p5_tr_map:go_recurse_from_root_by_build_element">
  253. <p5_tr_map:go_recurse_from_root_by_build_element>
  254. <xsl:attribute name="xsi:schemaLocation" select="'../../default_db_xml_cache.public/p5_tr_map.xsd'"/>
  255. <!--<xsl:attribute name="INSTANCE_ID" select="$INSTANCE_ID"/>
  256. <xsl:attribute name="element" select="$element"/>-->
  257. <xsl:for-each select="$schema_build_element">
  258. <xsl:apply-templates mode="system_cache__appinfo:go_recurse_from_root_by_build_element">
  259. <xsl:with-param name="parent_type" select="$element"/>
  260. <xsl:with-param name="root_name" select="$element"/>
  261. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  262. <xsl:sort select="@system_cache__appinfo:sort"/>
  263. </xsl:apply-templates>
  264. </xsl:for-each>
  265. </p5_tr_map:go_recurse_from_root_by_build_element>
  266. </xsl:variable>
  267. <xsl:result-document href="../default_db.instance.xml/p5_tr_map/go_recurse_from_root_by_build_element.xml">
  268. <xsl:copy-of select="$p5_tr_map:go_recurse_from_root_by_build_element"/>
  269. </xsl:result-document>
  270. </xsl:template>
  271. <!-- @2016-01-03 glownie na potrzeby dowiazywanych 477b complexType bez ref -->
  272. <xsl:template name="p5_tr_map:go_recurse_from_root_by_build_complexType">
  273. <!-- template @2015-04-23 do złożenia obiektu xml na podstawie wygenerowanego wypłaszczonego rekursywnie schematu -->
  274. <xsl:param name="complexType"/> <!-- nazwa instancyjnego obiektu do wyszukania -->
  275. <xsl:param name="INSTANCE_ID"/> <!-- numer ID obiektu do znalezienia-->
  276. <xsl:if test="$debug_level>3"><xsl:message>148 tworze wyplaszczony schemat dla elementu</xsl:message></xsl:if>
  277. <xsl:variable name="schema_build_element"><!-- budujemy schemat dla elementu do parsowania-->
  278. <xsl:call-template name="system_cache__appinfo:build_complexType">
  279. <xsl:with-param name="complexType" select="$complexType"/>
  280. </xsl:call-template>
  281. </xsl:variable>
  282. <!--<xsl:result-document href="../default_db.instance.xml/schema_build_element.xml">
  283. <xsl:copy-of select="$schema_build_element"/>
  284. </xsl:result-document>-->
  285. <xsl:message>161 tworze mape przetwarzania obiektu go_recurse_from_root_by_build_element</xsl:message>
  286. <xsl:variable name="p5_tr_map:go_recurse_from_root_by_build_element">
  287. <p5_tr_map:go_recurse_from_root_by_build_element>
  288. <xsl:attribute name="xsi:schemaLocation" select="'../../default_db_xml_cache.public/p5_tr_map.xsd'"/>
  289. <!--<xsl:attribute name="INSTANCE_ID" select="$INSTANCE_ID"/>
  290. <xsl:attribute name="element" select="$element"/>-->
  291. <temp><xsl:copy-of select="$schema_build_element"></xsl:copy-of></temp>
  292. <xsl:for-each select="$schema_build_element">
  293. <xsl:apply-templates mode="p5_tr_map:go_recurse_from_root_by_build_element">
  294. <xsl:with-param name="parent_type" select="$complexType"/>
  295. <xsl:with-param name="root_name" select="$complexType"/>
  296. <!--<xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>-->
  297. <xsl:sort select="@system_cache__appinfo:sort"/>
  298. </xsl:apply-templates>
  299. </xsl:for-each>
  300. </p5_tr_map:go_recurse_from_root_by_build_element>
  301. </xsl:variable>
  302. <xsl:result-document href="../default_db.instance.xml/p5_tr_map/go_recurse_from_root_by_build_element.xml">
  303. <xsl:copy-of select="$p5_tr_map:go_recurse_from_root_by_build_element"/>
  304. </xsl:result-document>
  305. </xsl:template>
  306. <xsl:template name="p5_tr_map:go_recurse_from_root_by_build_element_cache">
  307. <xsl:param name="parent_type" select="$parent_type"/>
  308. <xsl:param name="cache" select="'read'"/>
  309. <xsl:param name="output" select="'enable'"/>
  310. <xsl:variable name="schema_build_element" select="doc(system_cache__appinfo:element-filename('element',$parent_type,'',''))">
  311. <!--<xsl:call-template name="system_cache__appinfo:build_element_cache">
  312. <xsl:with-param name="element" select="$parent_type"/>
  313. </xsl:call-template>-->
  314. </xsl:variable>
  315. <xsl:message>#101 p5_tr_map:go_recurse_from_root_by_build_element_cache im here for <xsl:value-of select="$parent_type"/></xsl:message>
  316. <!--<xsl:param name="namespace_uri_param"/>-->
  317. <xsl:choose>
  318. <xsl:when test="unparsed-text-available(p5_tr_map:element-filename.complete('go_recurse_from_root_by_build_element_cache',$parent_type)) and $cache='read'">
  319. <xsl:message>96: copy cached data for element:<xsl:value-of select="p5_tr_map:element-filename('go_recurse_from_root_by_build_element_cache',$parent_type)"/>;</xsl:message>
  320. <xsl:if test="$output='enable'">
  321. <xsl:copy-of select="doc(p5_tr_map:element-filename('go_recurse_from_root_by_build_element_cache',$parent_type))"/>
  322. </xsl:if>
  323. </xsl:when>
  324. <xsl:otherwise>
  325. <xsl:variable name="go_recurse_from_root_by_build_element_cache">
  326. <p5_tr_map:go_recurse_from_root_by_build_element>
  327. <xsl:attribute name="xsi:schemaLocation" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd ../../default_db_xml_cache.public/p5_tr_map.xsd'"/>
  328. <xsl:apply-templates mode="p5_tr_map:go_recurse_from_root_by_build_element" select="$schema_build_element">
  329. <xsl:with-param name="parent_type" select="$parent_type"/>
  330. <xsl:with-param name="root_name" select="$parent_type"/>
  331. <!--<xsl:sort select="@system_cache__appinfo:sort"/>-->
  332. </xsl:apply-templates>
  333. </p5_tr_map:go_recurse_from_root_by_build_element>
  334. </xsl:variable>
  335. <xsl:if test="$go_recurse_from_root_by_build_element_cache/node()[local-name()]">
  336. <xsl:result-document href="{doc(p5_tr_map:element-filename.symlink('go_recurse_from_root_by_build_element_cache',$parent_type))}">
  337. <xsl:copy-of select="$go_recurse_from_root_by_build_element_cache"/>
  338. </xsl:result-document>
  339. <xsl:variable name="prefixed_object_info">
  340. <xsl:call-template name="system_cache__appinfo:prefixed_object_info">
  341. <xsl:with-param name="prefixed_object" select="$parent_type"/>
  342. </xsl:call-template>
  343. </xsl:variable>
  344. <!-- zapisanie w strukturze dla prefixu bazy danych elementu -->
  345. <xsl:result-document href="{p5_tr_map:element-filename-prefixed.symlink($parent_type)}">
  346. <xsl:copy-of select="$go_recurse_from_root_by_build_element_cache"/>
  347. </xsl:result-document>
  348. <xsl:result-document href="{p5_tr_map:element-filename.symlink.complete('go_recurse_from_root_by_build_element_cache',$parent_type)}">
  349. <complete/>
  350. </xsl:result-document>
  351. <xsl:if test="$output='enable'">
  352. <xsl:copy-of select="$go_recurse_from_root_by_build_element_cache"/>
  353. </xsl:if>
  354. </xsl:if>
  355. </xsl:otherwise>
  356. </xsl:choose>
  357. </xsl:template>
  358. <xsl:template name="p5_tr_map:go_recurse_from_root_by_build_complexType_cache">
  359. <xsl:param name="parent_type" select="$parent_type"/>
  360. <xsl:param name="cache" select="'read'"/>
  361. <xsl:param name="output" select="'enable'"/>
  362. <xsl:variable name="schema_build_element" select="doc(system_cache__appinfo:element-filename('complexType',$parent_type,'',''))">
  363. <!--<xsl:call-template name="system_cache__appinfo:build_complexType_cache">
  364. <xsl:with-param name="complexType" select="$parent_type"/>
  365. </xsl:call-template>-->
  366. </xsl:variable>
  367. <xsl:choose>
  368. <xsl:when test="unparsed-text-available(p5_tr_map:element-filename.complete('go_recurse_from_root_by_build_complexType_cache',$parent_type)) and $cache='read'"> <!-- concat('../default_db.instance.xml/p5_tr_map/complexType-',$element-filename,'.xml') -->
  369. <xsl:message>96: copy cached data for element:<xsl:value-of select="p5_tr_map:element-filename('go_recurse_from_root_by_build_complexType_cache',$parent_type)"/>;</xsl:message>
  370. <xsl:if test="$output='enable'">
  371. <xsl:copy-of select="doc(p5_tr_map:element-filename('go_recurse_from_root_by_build_complexType_cache',$parent_type))"/>
  372. </xsl:if>
  373. </xsl:when>
  374. <xsl:otherwise>
  375. <xsl:variable name="go_recurse_from_root_by_build_element_cache">
  376. <p5_tr_map:go_recurse_from_root_by_build_element>
  377. <xsl:attribute name="xsi:schemaLocation" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd ../../default_db_xml_cache.public/p5_tr_map.xsd'"/>
  378. <xsl:apply-templates mode="p5_tr_map:go_recurse_from_root_by_build_element" select="$schema_build_element">
  379. <xsl:with-param name="parent_type" select="$parent_type"/>
  380. <xsl:with-param name="root_name" select="$parent_type"/>
  381. <xsl:sort select="@system_cache__appinfo:sort"/>
  382. </xsl:apply-templates>
  383. </p5_tr_map:go_recurse_from_root_by_build_element>
  384. </xsl:variable>
  385. <xsl:if test="$go_recurse_from_root_by_build_element_cache/node()[local-name()]">
  386. <xsl:result-document href="{p5_tr_map:element-filename.symlink('go_recurse_from_root_by_build_complexType_cache',$parent_type)}">
  387. <xsl:copy-of select="$go_recurse_from_root_by_build_element_cache"/>
  388. </xsl:result-document>
  389. <xsl:result-document href="{p5_tr_map:element-filename.symlink.complete('go_recurse_from_root_by_build_complexType_cache',$parent_type)}">
  390. <complete/>
  391. </xsl:result-document>
  392. <xsl:if test="$output='enable'">
  393. <xsl:copy-of select="$go_recurse_from_root_by_build_element_cache"/>
  394. </xsl:if>
  395. </xsl:if>
  396. </xsl:otherwise>
  397. </xsl:choose>
  398. </xsl:template>
  399. <xsl:template match="*" mode="p5_tr_map:go_recurse_from_root_by_build_element.root">
  400. <p5_tr_map:go_recurse_from_root_by_build_element>
  401. <xsl:apply-templates mode="p5_tr_map:go_recurse_from_root_by_build_element" select=".">
  402. <xsl:with-param name="parent_type" select="$parent_type"/>
  403. <xsl:with-param name="root_name" select="$parent_type"/>
  404. </xsl:apply-templates>
  405. </p5_tr_map:go_recurse_from_root_by_build_element>
  406. </xsl:template>
  407. <!-- @2015-04-23 TEMPLATE DO TWORZENIA MAPY SCHEMATU SCIAGNIECIA OBIEKTOW - SERCE SYSTEMU -->
  408. <xsl:template match="*" mode="p5_tr_map:go_recurse_from_root_by_build_element">
  409. <!--<xsl:param name="system_cache__appinfo:schema_build_element"/> - to jest obiektem przetwarzania-->
  410. <xsl:param name="parent_type"/> <!-- nazwa rodzica dla poszukiwania w tabeli danego type w kolumnie type - jezeli dowiazywany jest jakis complexType po REMOTE_ID / ginie na sequence i ...?-->
  411. <xsl:param name="ID"/> <!-- przekazywany parametr rodzica -->
  412. <xsl:param name="INSTANCE_ID"/> <!-- flaga instancji ginie za pierwszym complexType -->
  413. <xsl:param name="parent_name"/> <!-- wyzwalene przez pierwszy element ktory ma complexType[@type], aby zachowac nazwe elementu ze schematu -->
  414. <xsl:param name="root_name"/> <!-- wyzwalane przez template w celu wykrywania w funkcji jaki element jest bazowy, aby do niego nie dowiazywac prefixow -->
  415. <xsl:param name="system_cache__appinfo:xpath_full"/> <!-- tworzona w locie sciezka xpath elementu razem z derewiacjami -->
  416. <xsl:param name="system_cache__appinfo:xpath"/> <!-- tworzona w locie sciezka xpath elementu od glownej derewiacji -->
  417. <xsl:param name="p5_tr_map:last-type"/><!-- ostatni ustalony typ, do wlasciwego przetwarzania zwlaszcza 477 -->
  418. <xsl:param name="p5_tr_map:parent_name"/><!-- narzcane przez 477 do wlasciwego wlaczania 481* ktore powtarzaja ta flage i koncza -->
  419. <xsl:param name="p5_tr_map:parent_type"/> <!-- narzucone przez 477b dla complexType -->
  420. <xsl:variable name="prefix" select="substring-before($parent_type,':')"/>
  421. <xsl:variable name="element_name" select="substring-after($parent_type,':')"/>
  422. <xsl:variable name="p5_tr_map:uuid" select="generate-id()"/>
  423. <!--<xsl:variable name="namespace_uri" select="exslt:node-set($vrtfNamespaces)//@uri[../@prefix=$prefix]"/>-->
  424. <!-- template sklada obiekt odwolujac sie do tabel w poszukiwaniu rekordu ID oraz nazwy ewentualnego obiektu rodzica-->
  425. <!--<xsl:comment>2205:<xsl:value-of select="local-name()"/> id:<xsl:value-of select="@id"/>;</xsl:comment>-->
  426. <xsl:variable name="p5_tr_map:current290" select="."/>
  427. <xsl:variable name="p5_tr_map:check_if_targetNamespaces_for_4777_list"><!--@2016-01-21 - todo przydalby sie parametr globalny - jakie schematy/targetNamespaces sluza do budowania obiektow silnikowych - do wyzwolenia na poziomie @element and @ref -->
  428. <xsl:if test="@ref and local-name()='element' and @id">
  429. <xsl:for-each select="$p5_tr_map:targetNamespaces_for_4777_list//p5_tr_map:targetNamespaces_for_4777">
  430. <xsl:variable name="foreach_294" select="."/>
  431. <xsl:if test="$p5_tr_map:current290/child::node()/@system_cache__appinfo:namespace_uri=$foreach_294">
  432. <xsl:value-of select="true()"/>
  433. </xsl:if>
  434. </xsl:for-each>
  435. </xsl:if>
  436. </xsl:variable>
  437. <xsl:choose>
  438. <xsl:when test="@system_cache__appinfo:only_complexContent_definition">
  439. <xsl:apply-templates mode="#current">
  440. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  441. <xsl:with-param name="ID" select="$ID"/>
  442. <xsl:with-param name="root_name" select="$root_name"/>
  443. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  444. <xsl:with-param name="system_cache__appinfo:xpath" select="$system_cache__appinfo:xpath"/>
  445. <xsl:with-param name="p5_tr_map:last-type" select="$p5_tr_map:last-type"/>
  446. <xsl:sort select="@system_cache__appinfo:sort"/>
  447. </xsl:apply-templates>
  448. </xsl:when>
  449. <xsl:when test="local-name()='simpleType'">
  450. <xsl:element name="system_cache__appinfo:schema">
  451. <xsl:copy-of select="."/>
  452. </xsl:element>
  453. </xsl:when>
  454. <xsl:when test="local-name()='simpleContent'"> <!-- warunek odpuszczamy i nie rysujemy elementu -->
  455. <xsl:apply-templates mode="#current">
  456. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie potrzeba dla takiego przypadku juz przekazywac typu instancji -->
  457. <xsl:with-param name="ID" select="$ID"/>
  458. <xsl:with-param name="root_name" select="$root_name"/>
  459. <xsl:sort select="@system_cache__appinfo:sort"/>
  460. </xsl:apply-templates>
  461. </xsl:when>
  462. <xsl:when test=" local-name()='attributeGroup' or local-name()='group'"> <!-- warunek 436 nie ma dziecka - jest simple - powinno się go pobrac -->
  463. <p5_tr_map:go_recurse_from_root_by_build_element_436>
  464. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  465. <xsl:attribute name="comment" select="'436 @2016-01-05 TODO powstanie blad w przetwarzaniu - elementy z grup powinny byc traktowane jako referencje i instancje lub jakos inaczej odpuszczamy simpleContent,attributeGroup,group i nizej bedziemy uzywac atrybutow jak zwyklych simpleType do PARENT'"/>
  466. <xsl:attribute name="event_type" select="436"/>
  467. <xsl:attribute name="local-name" select="local-name()"/>
  468. <xsl:attribute name="local-name-name" select="@name"/>
  469. <xsl:apply-templates mode="#current">
  470. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie potrzeba dla takiego przypadku juz przekazywac typu instancji -->
  471. <xsl:with-param name="ID" select="$ID"/>
  472. <xsl:with-param name="root_name" select="$root_name"/>
  473. <xsl:sort select="@system_cache__appinfo:sort"/>
  474. </xsl:apply-templates>
  475. </p5_tr_map:go_recurse_from_root_by_build_element_436>
  476. </xsl:when>
  477. <!-- simpleContent after refferred begin -->
  478. <xsl:when test="not($parent_type) and ( local-name()='complexType' ) and parent::node()[local-name()='complexType'] and child::node()[local-name()='complexType'] and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') and descendant::node()/local-name()='simpleContent' )"> <!-- warunek 3811 dla simpleContent tutaj jest tabela z dodatkowa derewiacja @type , z instancjami z dwoch stron parent:: and child::, obcych obiektow (ComplexType), pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type)-->
  479. <p5_tr_map:go_recurse_from_root_by_build_element_3811>
  480. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  481. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  482. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  483. <xsl:attribute name="local-name" select="local-name()"/>
  484. <xsl:attribute name="local-name-name" select="@name"/>
  485. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  486. <xsl:attribute name="event_type" select="3811"/>
  487. <xsl:attribute name="parent_name" select="$parent_name"/>
  488. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  489. <xsl:attribute name="comment" select="'3811 dla simpleContent tutaj jest tabela z dodatkowa derewiacja @type, z instancjami z dwoch stron parent:: and child:: , obych obiektow (ComplexType) , pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type) '"/>
  490. <xsl:for-each select="@*">
  491. <xsl:choose>
  492. <xsl:when test="substring-before(name(),':')">
  493. <xsl:attribute name="{name()}" select="."/>
  494. </xsl:when>
  495. <xsl:otherwise>
  496. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  497. </xsl:otherwise>
  498. </xsl:choose>
  499. </xsl:for-each>
  500. <xsl:apply-templates mode="#current">
  501. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  502. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  503. <xsl:with-param name="root_name" select="$root_name"/>
  504. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  505. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  506. <xsl:sort select="@system_cache__appinfo:sort"/>
  507. </xsl:apply-templates>
  508. </p5_tr_map:go_recurse_from_root_by_build_element_3811>
  509. </xsl:when>
  510. <xsl:when test="not($parent_type) and local-name()='complexType' and parent::node()[local-name()='complexType'] and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') and descendant::node()/local-name()='simpleContent' )"> <!-- warunek 3810 dla simpleContent jest tabela dodatkowa z derewiacja @type, z instancjami, obcych obiektow -->
  511. <p5_tr_map:go_recurse_from_root_by_build_element_3810>
  512. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  513. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  514. <xsl:attribute name="local-name" select="local-name()"/>
  515. <xsl:attribute name="local-name-name" select="@name"/>
  516. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  517. <xsl:attribute name="event_type" select="3810"/>
  518. <xsl:attribute name="parent_name" select="$parent_name"/>
  519. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  520. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  521. <xsl:attribute name="comment" select="'warunek 3810 dla simpleContent jest tabela dodatkowa z derewiacja @type, z instancjami, obcych obiektow'"/>
  522. <xsl:for-each select="@*">
  523. <xsl:choose>
  524. <xsl:when test="substring-before(name(),':')">
  525. <xsl:attribute name="{name()}" select="."/>
  526. </xsl:when>
  527. <xsl:otherwise>
  528. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  529. </xsl:otherwise>
  530. </xsl:choose>
  531. </xsl:for-each>
  532. <xsl:apply-templates mode="#current">
  533. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  534. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  535. <xsl:with-param name="root_name" select="$root_name"/>
  536. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  537. <xsl:sort select="@system_cache__appinfo:sort"/>
  538. </xsl:apply-templates>
  539. </p5_tr_map:go_recurse_from_root_by_build_element_3810>
  540. </xsl:when>
  541. <xsl:when test="not($parent_type) and local-name()='complexType' and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') and descendant::node()/local-name()='simpleContent' ) and child::node()[local-name()='complexType']"> <!-- warunek 3812 derewiacja simpleContent na child::node=complexType, z instancjami... -->
  542. <p5_tr_map:go_recurse_from_root_by_build_element_3812>
  543. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  544. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  545. <xsl:attribute name="local-name" select="local-name()"/>
  546. <xsl:attribute name="local-name-name" select="@name"/>
  547. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  548. <xsl:attribute name="event_type" select="3812"/>
  549. <xsl:attribute name="parent_name" select="$parent_name"/>
  550. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  551. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  552. <xsl:attribute name="comment" select="'3812 derewiacja simpleContent na child::node=complexType, z instancjami , pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type) '"/>
  553. <xsl:for-each select="@*">
  554. <xsl:choose>
  555. <xsl:when test="substring-before(name(),':')">
  556. <xsl:attribute name="{name()}" select="."/>
  557. </xsl:when>
  558. <xsl:otherwise>
  559. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  560. </xsl:otherwise>
  561. </xsl:choose>
  562. </xsl:for-each>
  563. <xsl:apply-templates mode="#current">
  564. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  565. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  566. <xsl:with-param name="root_name" select="$root_name"/>
  567. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  568. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  569. <xsl:sort select="@system_cache__appinfo:sort"/>
  570. </xsl:apply-templates>
  571. </p5_tr_map:go_recurse_from_root_by_build_element_3812>
  572. </xsl:when>
  573. <xsl:when test="not($parent_type) and ( ( local-name()='complexType' and child::node()/local-name()='simpleContent') ) and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') ) "> <!-- warunek 381 po refie simpleContent -->
  574. <p5_tr_map:go_recurse_from_root_by_build_element_381>
  575. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  576. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  577. <xsl:attribute name="local-name" select="local-name()"/>
  578. <xsl:attribute name="local-name-name" select="@name"/>
  579. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  580. <xsl:attribute name="event_type" select="'381'"/>
  581. <xsl:attribute name="parent_name" select="$parent_name"/>
  582. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  583. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  584. <xsl:attribute name="comment" select="'381 tutaj jest tabela z instancjami obych obiektow (simpleContent) , pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type) '"/>
  585. <xsl:for-each select="@*">
  586. <xsl:choose>
  587. <xsl:when test="substring-before(name(),':')">
  588. <xsl:attribute name="{name()}" select="."/>
  589. </xsl:when>
  590. <xsl:otherwise>
  591. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  592. </xsl:otherwise>
  593. </xsl:choose>
  594. </xsl:for-each>
  595. <xsl:apply-templates mode="#current">
  596. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  597. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  598. <xsl:with-param name="root_name" select="$root_name"/>
  599. <xsl:with-param name="p5_tr_map:last-type" select="'381'"/>
  600. <xsl:sort select="@system_cache__appinfo:sort"/>
  601. </xsl:apply-templates>
  602. </p5_tr_map:go_recurse_from_root_by_build_element_381>
  603. </xsl:when>
  604. <!-- simpleContent after refferred end -->
  605. <xsl:when test="not($parent_type) and local-name()='element' and ( $p5_tr_map:last-type!='477' and $p5_tr_map:last-type!='477b' ) and ( ( @type and not(child::node()) ) or child::node()/local-name()='simpleType' )"> <!-- warunek 428 nie ma dziecka - jest simple - powinno się go pobrac -->
  606. <p5_tr_map:go_recurse_from_root_by_build_element_428>
  607. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  608. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  609. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--> <!-- nie ma potrzeby wskazywania na typ, bo powiazany obiekt nie jest instancyjny-->
  610. <xsl:attribute name="local-name" select="local-name()"/>
  611. <xsl:attribute name="local-name-name" select="@name"/>
  612. <xsl:variable name="system_cache__appinfo:xpath_full">
  613. <xsl:choose>
  614. <xsl:when test="$system_cache__appinfo:xpath_full">
  615. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  616. </xsl:when>
  617. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  618. </xsl:choose>
  619. </xsl:variable>
  620. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  621. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  622. <xsl:choose>
  623. <xsl:when test="substring-before($root_name,':')=@system_cache__appinfo:prefix"> <!-- dla lokalnego elementu prefixu nie dajemy prefixu -->
  624. <xsl:attribute name="create_element" select="@name"/>
  625. </xsl:when>
  626. <xsl:otherwise>
  627. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  628. </xsl:otherwise>
  629. </xsl:choose>
  630. <xsl:attribute name="event_type" select="428"/>
  631. <xsl:attribute name="comment" select="concat('428 - parent_name:',$root_name)"/>
  632. <xsl:for-each select="@*">
  633. <xsl:choose>
  634. <xsl:when test="substring-before(name(),':')">
  635. <xsl:attribute name="{name()}" select="."/>
  636. </xsl:when>
  637. <xsl:otherwise>
  638. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  639. </xsl:otherwise>
  640. </xsl:choose>
  641. </xsl:for-each>
  642. <xsl:comment>428 nie ma dziecka jest simple - pobieramy element z bazy szukajac PARENT_ID - np. MAGAZYN/sequence/T_TELBOX_TYPE:xs:simple, ktory ma dane w ID, VALUE </xsl:comment>
  643. </p5_tr_map:go_recurse_from_root_by_build_element_428>
  644. </xsl:when>
  645. <xsl:when test="local-name()='element' and @type and child::* and $parent_type and @id and ( not(child::node()/local-name()='simpleType') and not(child::node()/local-name()='simpleContent') ) and ( descendant::node()/local-name()='complexType' ) "> <!-- warunek 434 przepuszczenie pierszego elementu jezeli ma @type, nie ma dzieci? i ma ../@ref - czyli byl przed 477 -->
  646. <p5_tr_map:go_recurse_from_root_by_build_element_434>
  647. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  648. <xsl:attribute name="comment" select="concat('434 przepuszczenie pierwszego elementu jezeli ma @type - magazynujemy go w complexType nizej local-name:',local-name(),' @name:',@name,' @id:',@id,' INSTANCE_ID:',$INSTANCE_ID,' np. dla elementu MAGAZYN, ktory ma @type MAGAZYN')"/>
  649. <xsl:attribute name="event_type" select="434"/>
  650. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  651. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  652. <xsl:attribute name="parent_type" select="$parent_type"/>
  653. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  654. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  655. <xsl:choose>
  656. <xsl:when test="$parent_name">
  657. <xsl:apply-templates mode="#current">
  658. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  659. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  660. <xsl:with-param name="parent_name" select="$parent_name"/>
  661. <xsl:with-param name="root_name" select="$root_name"/>
  662. <xsl:sort select="@system_cache__appinfo:sort"/>
  663. </xsl:apply-templates>
  664. </xsl:when>
  665. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  666. <xsl:apply-templates mode="#current">
  667. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  668. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  669. <xsl:with-param name="parent_name" select="@name"/>
  670. <xsl:with-param name="root_name" select="$root_name"/>
  671. <xsl:sort select="@system_cache__appinfo:sort"/>
  672. </xsl:apply-templates>
  673. </xsl:otherwise>
  674. </xsl:choose>
  675. </p5_tr_map:go_recurse_from_root_by_build_element_434>
  676. </xsl:when>
  677. <xsl:when test="local-name()='element' and not(@type) and child::node()/local-name()='complexType' and not(@system_cache__appinfo:root_element_in_schema='true')" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"> <!-- element|sequence/complexType/element|sequence|attribute - to jest to cos w rodzaju sequence - element bez wartosci - do ktorego mozna gromadzic atrybuty lub inne elementy - nowy warunek 473b ( bylo warunek 434b przepuszczenie pierszego elementu dla przypadku //schema/element/complexType ) -->
  678. <!--<p5_tr_map:go_recurse_from_root_by_build_element_434b>
  679. <xsl:attribute name="comment" select="concat('434b przepuszczenie pierszego elementu dla przypadku //schema/element/complexType - magazynujemy go w complexType nizej local-name:',local-name(),' @name:',@name,' @id:',@id,' INSTANCE_ID:',$INSTANCE_ID,' np. dla elementu teryt(..):WOJ , ktory ma nizej complexType')"/>
  680. <xsl:attribute name="event_type" select="'434b'"/>
  681. <xsl:attribute name="event_name" select="'element[]/complexType'"/>
  682. <xsl:attribute name="id" select="@id"/>
  683. <xsl:choose>
  684. <xsl:when test="$parent_name">
  685. <xsl:apply-templates mode="#current">
  686. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  687. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  688. <xsl:with-param name="parent_name" select="$parent_name"/>
  689. <xsl:with-param name="root_name" select="$root_name"/>
  690. <xsl:sort select="@system_cache__appinfo:sort"/>
  691. </xsl:apply-templates>
  692. </xsl:when>
  693. <xsl:otherwise><!-\- wymuszamy parent_type jak go nie ma za pierwszym razem -\->
  694. <xsl:apply-templates mode="#current">
  695. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  696. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  697. <xsl:with-param name="parent_name" select="@name"/>
  698. <xsl:with-param name="root_name" select="$root_name"/>
  699. <xsl:sort select="@system_cache__appinfo:sort"/>
  700. </xsl:apply-templates>
  701. </xsl:otherwise>
  702. </xsl:choose>
  703. </p5_tr_map:go_recurse_from_root_by_build_element_434b>-->
  704. <p5_tr_map:go_recurse_from_root_by_build_element_473b>
  705. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  706. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  707. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>-->
  708. <xsl:attribute name="retrieve_resource_id" select="@id"/>
  709. <xsl:attribute name="local-name" select="local-name()"/>
  710. <xsl:attribute name="event_type" select="'473b'"/>
  711. <xsl:attribute name="comment" select="'warunek 473b element complexType z dowiazanymi innymi elementami/atrybutami - do traktowania podobnie jak sekwencje @2016-05 todo'"/>
  712. <xsl:for-each select="@*">
  713. <xsl:choose>
  714. <xsl:when test="substring-before(name(),':')">
  715. <xsl:attribute name="{name()}" select="."/>
  716. </xsl:when>
  717. <xsl:otherwise>
  718. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  719. </xsl:otherwise>
  720. </xsl:choose>
  721. </xsl:for-each>
  722. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  723. <xsl:comment>warunek 473b element complexType z dowiazanymi innymi elementami/atrybutami - do traktowania podobnie jak sekwencje @2016-05 todo </xsl:comment>
  724. <xsl:apply-templates mode="#current">
  725. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- todo brakuje prefixu-->
  726. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  727. <xsl:with-param name="root_name" select="$root_name"/>
  728. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  729. <xsl:with-param name="system_cache__appinfo:xpath" select="$system_cache__appinfo:xpath"/>
  730. <xsl:with-param name="p5_tr_map:last-type" select="'473'"/>
  731. <xsl:sort select="@system_cache__appinfo:sort"/>
  732. </xsl:apply-templates>
  733. </p5_tr_map:go_recurse_from_root_by_build_element_473b>
  734. </xsl:when>
  735. <xsl:when test="local-name()='complexType' and not($p5_tr_map:parent_name) and not($parent_type) and not($p5_tr_map:parent_type) and not(@type)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"> <!-- ( bylo warunek 434b przepuszczenie pierszego elementu dla przypadku //schema/element/complexType ) -->
  736. <p5_tr_map:go_recurse_from_root_by_build_element_434b>
  737. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  738. <xsl:attribute name="comment" select="concat('434b przepuszczenie pierszego elementu dla przypadku //schema/element/complexType - magazynujemy go w complexType nizej local-name:',local-name(),' @name:',@name,' @id:',@id,' INSTANCE_ID:',$INSTANCE_ID,' np. dla elementu teryt(..):WOJ , ktory ma nizej complexType')"/>
  739. <xsl:attribute name="event_type" select="'434b'"/>
  740. <xsl:attribute name="event_name" select="'element[]/complexType'"/>
  741. <xsl:attribute name="id" select="@id"/>
  742. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  743. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  744. <!--<xsl:attribute name="parent_name" select="$parent_name"/>-->
  745. <xsl:choose>
  746. <xsl:when test="$parent_name">
  747. <xsl:apply-templates mode="#current">
  748. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  749. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  750. <xsl:with-param name="parent_name" select="$parent_name"/>
  751. <xsl:with-param name="root_name" select="$root_name"/>
  752. <xsl:sort select="@system_cache__appinfo:sort"/>
  753. </xsl:apply-templates>
  754. </xsl:when>
  755. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  756. <xsl:apply-templates mode="#current">
  757. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  758. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  759. <xsl:with-param name="parent_name" select="@name"/>
  760. <xsl:with-param name="root_name" select="$root_name"/>
  761. <xsl:sort select="@system_cache__appinfo:sort"/>
  762. </xsl:apply-templates>
  763. </xsl:otherwise>
  764. </xsl:choose>
  765. </p5_tr_map:go_recurse_from_root_by_build_element_434b>
  766. </xsl:when>
  767. <xsl:when test="local-name()='element' and @type and child::*/local-name()!='simpleType' and $p5_tr_map:last-type='477' and not(@id)"> <!-- warunek 434n zaraz po 477 ktore sie tyczy zasobow z bazy danych , ktore nie maja @id - TODO jakos madrzej trzeba to wykryc -->
  768. <p5_tr_map:go_recurse_from_root_by_build_element_434n>
  769. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  770. <xsl:attribute name="comment" select="concat('434n przepuszczenie @complexType po ref 477 local-name:',local-name(),' @name:',@name,' INSTANCE_ID:',$INSTANCE_ID,' np. dla elementu MAGAZYN, ktory ma @type MAGAZYN, dotyczy elementow z plaskich struktur istniejacego systemu, do ktorego sa dowiazywane obiekty zaglebione')"/>
  771. <xsl:attribute name="event_type" select="'434n'"/>
  772. <!--<xsl:attribute name="system_cache__appinfo:id" select="@id"/>-->
  773. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  774. <xsl:attribute name="parent_type" select="$parent_type"/>
  775. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  776. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  777. <xsl:choose>
  778. <xsl:when test="$parent_name">
  779. <xsl:apply-templates mode="#current">
  780. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  781. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  782. <xsl:with-param name="parent_name" select="$parent_name"/>
  783. <xsl:with-param name="root_name" select="$root_name"/>
  784. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  785. <xsl:with-param name="p5_tr_map:last-type" select="'434n'"/>
  786. <xsl:sort select="@system_cache__appinfo:sort"/>
  787. </xsl:apply-templates>
  788. </xsl:when>
  789. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  790. <xsl:apply-templates mode="#current">
  791. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  792. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  793. <xsl:with-param name="parent_name" select="@name"/>
  794. <xsl:with-param name="root_name" select="$root_name"/>
  795. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  796. <xsl:with-param name="p5_tr_map:last-type" select="'434n'"/>
  797. <xsl:sort select="@system_cache__appinfo:sort"/>
  798. </xsl:apply-templates>
  799. </xsl:otherwise>
  800. </xsl:choose>
  801. </p5_tr_map:go_recurse_from_root_by_build_element_434n>
  802. </xsl:when>
  803. <xsl:when test="local-name()='element' and @type and child::*/local-name()!='simpleType' and $p5_tr_map:last-type='4777' and not(@id)"> <!-- warunek 434nt zaraz po 4777 ktore sie tyczy zasobow z bazy danych natywnych , ktore nie maja @id - TODO jakos madrzej trzeba to wykryc -->
  804. <p5_tr_map:go_recurse_from_root_by_build_element_434nt>
  805. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  806. <xsl:attribute name="comment" select="concat('434nt przepuszczenie @complexType po ref 4777 local-name:',local-name(),' @name:',@name,' INSTANCE_ID:',$INSTANCE_ID,' np. dla elementu MAGAZYN, ktory ma @type MAGAZYN, dotyczy elementow z plaskich struktur istniejacego systemu, do ktorego sa dowiazywane obiekty zaglebione')"/>
  807. <xsl:attribute name="event_type" select="'434nt'"/>
  808. <!--<xsl:attribute name="system_cache__appinfo:id" select="@id"/>-->
  809. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  810. <xsl:attribute name="parent_type" select="$parent_type"/>
  811. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  812. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  813. <xsl:choose>
  814. <xsl:when test="$parent_name">
  815. <xsl:apply-templates mode="#current">
  816. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  817. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  818. <xsl:with-param name="parent_name" select="$parent_name"/>
  819. <xsl:with-param name="root_name" select="$root_name"/>
  820. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  821. <xsl:with-param name="p5_tr_map:last-type" select="'434n'"/>
  822. <xsl:sort select="@system_cache__appinfo:sort"/>
  823. </xsl:apply-templates>
  824. </xsl:when>
  825. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  826. <xsl:apply-templates mode="#current">
  827. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  828. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  829. <xsl:with-param name="parent_name" select="@name"/>
  830. <xsl:with-param name="root_name" select="$root_name"/>
  831. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  832. <xsl:with-param name="p5_tr_map:last-type" select="'434nt'"/>
  833. <xsl:sort select="@system_cache__appinfo:sort"/>
  834. </xsl:apply-templates>
  835. </xsl:otherwise>
  836. </xsl:choose>
  837. </p5_tr_map:go_recurse_from_root_by_build_element_434nt>
  838. </xsl:when>
  839. <xsl:when test="local-name()='element' and @type and child::*/local-name()!='simpleType' and $p5_tr_map:last-type='477' "> <!-- warunek 434c zaraz po 477 -->
  840. <p5_tr_map:go_recurse_from_root_by_build_element_434c>
  841. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  842. <xsl:attribute name="comment" select="concat('434c przepuszczenie @complexType po ref 477 local-name:',local-name(),' @name:',@name,' @id:',@id,' INSTANCE_ID:',$INSTANCE_ID,' np. dla elementu MAGAZYN, ktory ma @type MAGAZYN')"/>
  843. <xsl:attribute name="event_type" select="'434c'"/>
  844. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  845. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  846. <xsl:attribute name="parent_type" select="$parent_type"/>
  847. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  848. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  849. <xsl:choose>
  850. <xsl:when test="$parent_name">
  851. <xsl:apply-templates mode="#current">
  852. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  853. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  854. <xsl:with-param name="parent_name" select="$parent_name"/>
  855. <xsl:with-param name="root_name" select="$root_name"/>
  856. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  857. <xsl:sort select="@system_cache__appinfo:sort"/>
  858. </xsl:apply-templates>
  859. </xsl:when>
  860. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  861. <xsl:apply-templates mode="#current">
  862. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  863. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  864. <xsl:with-param name="parent_name" select="@name"/>
  865. <xsl:with-param name="root_name" select="$root_name"/>
  866. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  867. <xsl:sort select="@system_cache__appinfo:sort"/>
  868. </xsl:apply-templates>
  869. </xsl:otherwise>
  870. </xsl:choose>
  871. </p5_tr_map:go_recurse_from_root_by_build_element_434c>
  872. </xsl:when>
  873. <xsl:when test="local-name()='element' and not(@type) and child::node()[local-name()='complexType' and not(@system_cache__appinfo:only_complexContent_definition)] and @system_cache__appinfo:root_element_in_schema='true' and @name and $parent_type "> <!-- warunek 434d /schema/!!!element!!!/complexType bez @type w glownym wywolaniu -->
  874. <p5_tr_map:go_recurse_from_root_by_build_element_434d>
  875. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  876. <xsl:attribute name="comment" select="concat('434d przepuszczenie elementu na root, bez @type local-name:',local-name(),' @name:',@name,' @id:',@id,' INSTANCE_ID:',$INSTANCE_ID,' np. dla prove_portal:klient')"/>
  877. <xsl:attribute name="event_type" select="'434d'"/>
  878. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  879. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  880. <xsl:attribute name="parent_type" select="$parent_type"/>
  881. <xsl:attribute name="system_cache__appinfo:name" select="@name"/>
  882. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  883. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  884. <xsl:choose>
  885. <!--<xsl:when test="$parent_name">
  886. <xsl:apply-templates mode="#current">
  887. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  888. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  889. <xsl:with-param name="parent_name" select="$parent_name"/>
  890. <xsl:with-param name="root_name" select="$root_name"/>
  891. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  892. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  893. <xsl:sort select="@system_cache__appinfo:sort"/>
  894. </xsl:apply-templates>
  895. </xsl:when>-->
  896. <xsl:when test="1=2"/>
  897. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  898. <xsl:apply-templates mode="#current">
  899. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  900. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  901. <xsl:with-param name="parent_name" select="@name"/>
  902. <xsl:with-param name="root_name" select="$root_name"/>
  903. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  904. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  905. <xsl:sort select="@system_cache__appinfo:sort"/>
  906. </xsl:apply-templates>
  907. </xsl:otherwise>
  908. </xsl:choose>
  909. </p5_tr_map:go_recurse_from_root_by_build_element_434d>
  910. </xsl:when>
  911. <xsl:when test="local-name()='element' and not(@type) and child::node()[local-name()='complexType' and @system_cache__appinfo:only_complexContent_definition] and @system_cache__appinfo:root_element_in_schema='true' and @name and $parent_type "> <!-- warunek 434d /schema/!!!element!!!/complexType bez @type w glownym wywolaniu -->
  912. <p5_tr_map:go_recurse_from_root_by_build_element_434er>
  913. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  914. <xsl:attribute name="comment" select="concat('434er element z lokalnym extension/restriction z @type . przepuszczenie elementu na root, bez @type local-name:',local-name(),' @name:',@name,' @id:',@id,' INSTANCE_ID:',$INSTANCE_ID,' np. dla prove_portal:klient')"/>
  915. <xsl:attribute name="event_type" select="'434er'"/>
  916. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  917. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  918. <xsl:attribute name="parent_type" select="$parent_type"/>
  919. <xsl:attribute name="system_cache__appinfo:name" select="@name"/>
  920. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  921. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  922. <xsl:choose>
  923. <!--<xsl:when test="$parent_name">
  924. <xsl:apply-templates mode="#current">
  925. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  926. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  927. <xsl:with-param name="parent_name" select="$parent_name"/>
  928. <xsl:with-param name="root_name" select="$root_name"/>
  929. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  930. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  931. <xsl:sort select="@system_cache__appinfo:sort"/>
  932. </xsl:apply-templates>
  933. </xsl:when>-->
  934. <xsl:when test="1=2"/>
  935. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  936. <xsl:apply-templates mode="#current">
  937. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  938. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  939. <xsl:with-param name="parent_name" select="@name"/>
  940. <xsl:with-param name="root_name" select="$root_name"/>
  941. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  942. <xsl:with-param name="p5_tr_map:last-type" select="'434er'"/>
  943. <xsl:sort select="@system_cache__appinfo:sort"/>
  944. </xsl:apply-templates>
  945. </xsl:otherwise>
  946. </xsl:choose>
  947. </p5_tr_map:go_recurse_from_root_by_build_element_434er>
  948. </xsl:when>
  949. <xsl:when test="local-name()='element' and not(@type) and child::node()[local-name()='complexType'] and @system_cache__appinfo:root_element_in_schema='true' and @name and not($parent_type)"> <!-- warunek 434r w !__element__! = /schema/complexType//@ref/!__element__!/complexType bez @type w glownym wywolaniu -->
  950. <p5_tr_map:go_recurse_from_root_by_build_element_434r>
  951. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  952. <xsl:attribute name="comment" select="concat('434r warunek 434r w !__element__! = /schema/complexType//@ref/!__element__!/complexType bez @type w glownym wywolaniu local-name:',local-name(),' @name:',@name,' @id:',@id,' INSTANCE_ID:',$INSTANCE_ID,' np. dla prove_portal:klient')"/>
  953. <xsl:attribute name="event_type" select="'434r'"/>
  954. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  955. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  956. <xsl:attribute name="parent_type" select="$parent_type"/>
  957. <xsl:attribute name="system_cache__appinfo:name" select="@name"/>
  958. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  959. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  960. <xsl:choose>
  961. <!--<xsl:when test="$parent_name">
  962. <xsl:apply-templates mode="#current">
  963. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  964. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  965. <xsl:with-param name="parent_name" select="$parent_name"/>
  966. <xsl:with-param name="root_name" select="$root_name"/>
  967. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  968. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  969. <xsl:sort select="@system_cache__appinfo:sort"/>
  970. </xsl:apply-templates>
  971. </xsl:when>-->
  972. <xsl:when test="1=2"/>
  973. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  974. <xsl:apply-templates mode="#current">
  975. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  976. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  977. <xsl:with-param name="parent_name" select="@name"/>
  978. <xsl:with-param name="root_name" select="$root_name"/>
  979. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  980. <xsl:with-param name="p5_tr_map:last-type" select="'434r'"/>
  981. <xsl:sort select="@system_cache__appinfo:sort"/>
  982. </xsl:apply-templates>
  983. </xsl:otherwise>
  984. </xsl:choose>
  985. </p5_tr_map:go_recurse_from_root_by_build_element_434r>
  986. </xsl:when>
  987. <xsl:when test="not($parent_type) and local-name()='element' and @type and child::* and $p5_tr_map:last-type!='477' and @id"> <!-- 477b wymuszenie 477 na pierwszym elemencie ktory jest @complexType i nie jest ref 477 -->
  988. <p5_tr_map:go_recurse_from_root_by_build_element_477b>
  989. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  990. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  991. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  992. <xsl:attribute name="local-name" select="local-name()"/>
  993. <xsl:attribute name="local-name-name" select="@name"/>
  994. <xsl:attribute name="create_element" select="@name"/>
  995. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  996. <xsl:attribute name="event_type" select="'477b'"/>
  997. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  998. <xsl:attribute name="comment" select="'477b uzyty ComplexType bez @ref w elemencie - symulacja pobrania elementu jak z @ref i musi miec REMOTE_ID'"/>
  999. <xsl:variable name="system_cache__appinfo:xpath_full">
  1000. <xsl:choose>
  1001. <xsl:when test="$system_cache__appinfo:xpath_full">
  1002. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@type)"/>
  1003. </xsl:when>
  1004. <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
  1005. </xsl:choose>
  1006. </xsl:variable>
  1007. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1008. <xsl:for-each select="@*">
  1009. <xsl:choose>
  1010. <xsl:when test="substring-before(name(),':')">
  1011. <xsl:attribute name="{name()}" select="."/>
  1012. </xsl:when>
  1013. <xsl:otherwise>
  1014. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1015. </xsl:otherwise>
  1016. </xsl:choose>
  1017. </xsl:for-each>
  1018. <xsl:variable name="p5_tr_map:detect_loop_from_build_complexType_node">
  1019. <xsl:apply-templates mode="p5_tr_map:detect_loop_from_build_complexType_node"/>
  1020. </xsl:variable>
  1021. <xsl:choose>
  1022. <xsl:when test="$p5_tr_map:detect_loop_from_build_complexType_node/p5_tr_map:detect_loop_from_build_complexType_node">
  1023. <xsl:attribute name="system_cache__appinfo:loop_name" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_name"/>
  1024. <xsl:attribute name="system_cache__appinfo:loop_id" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_id"/>
  1025. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_name_with_prefix"/>
  1026. <xsl:attribute name="p5_tr_map:detect_loop_from_build_complexType_node_comment" select="'detected loop from template p5_tr_map:detect_loop_from_build_complexType_node'"/>
  1027. </xsl:when>
  1028. <xsl:otherwise>
  1029. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1030. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1031. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1032. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1033. </xsl:if>
  1034. </xsl:otherwise>
  1035. </xsl:choose>
  1036. <xsl:apply-templates mode="#current">
  1037. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1038. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1039. <xsl:with-param name="root_name" select="$root_name"/>
  1040. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1041. <xsl:with-param name="p5_tr_map:last-type" select="'477b'"/>
  1042. <xsl:with-param name="p5_tr_map:parent_type" select="@type"/>
  1043. <!--<xsl:with-param name="parent_type" select="@type"/>-->
  1044. <xsl:sort select="@system_cache__appinfo:sort"/>
  1045. </xsl:apply-templates>
  1046. </p5_tr_map:go_recurse_from_root_by_build_element_477b>
  1047. </xsl:when>
  1048. <xsl:when test="local-name()='complexType' and child::node()[@system_cache__appinfo:restriciction_base]"> <!-- warunek 710 - przepuszczenie complexType jezeli dziecko powstalo na bazie restrykcji (oszczedzamy 1 tabele instancji) -->
  1049. <p5_tr_map:go_recurse_from_root_by_build_element_710>
  1050. <xsl:attribute name="event_type" select="710"/>
  1051. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1052. <xsl:attribute name="comment" select="concat('710 przepuszczenie complexType jezeli dziecko powstal na bazie restrykcji (oszczedzamy 1 tabele instancji) local-name:',local-name(),' @name:',@name,' @id:',@id,' np dla element T:MAGAZYN=restriction(LOKALIZACJA)')"/>
  1053. <xsl:apply-templates mode="#current">
  1054. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1055. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  1056. <xsl:with-param name="root_name" select="$root_name"/>
  1057. <xsl:sort select="@system_cache__appinfo:sort"/>
  1058. </xsl:apply-templates>
  1059. </p5_tr_map:go_recurse_from_root_by_build_element_710>
  1060. </xsl:when>
  1061. <xsl:when test="local-name()='complexType' and not(@id) and $p5_tr_map:last-type='434nt'"> <!-- warunek 734 - pobranie elemnetu z np. default_db bo nie ma @id -->
  1062. <p5_tr_map:go_recurse_from_root_by_build_element_734>
  1063. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1064. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!--nie potrzeba oczekiwanego typu - zaciagamy rekord z ID-->
  1065. <xsl:attribute name="local-name" select="local-name()"/>
  1066. <xsl:attribute name="local-name-name" select="@name"/>
  1067. <xsl:attribute name="copy-retrieved-element" select="'*'"/> <!-- nalezy skopiowac cala zawartosc sciagnietego elementu XML z api -->
  1068. <xsl:attribute name="event_type" select="734"/>
  1069. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1070. <xsl:attribute name="comment" select="'734 pobranie elementu zwyczajowo z default_db, bo nie ma @id i jest complextype np. MAGAZYN/sequence/default_db:TELBOXES/(obiekt z tabeli TELBOXES z ID=@REMOTE_ID)'"/>
  1071. <xsl:for-each select="@*">
  1072. <xsl:choose>
  1073. <xsl:when test="substring-before(name(),':')">
  1074. <xsl:attribute name="{name()}" select="."/>
  1075. </xsl:when>
  1076. <xsl:otherwise>
  1077. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1078. </xsl:otherwise>
  1079. </xsl:choose>
  1080. </xsl:for-each>
  1081. <xsl:comment>734 pobranie elementu zwyczajowo z default_db, bo nie ma @id i jest complextype np. MAGAZYN/sequence/default_db:TELBOXES/(obiekt z tabeli TELBOXES z ID=@REMOTE_ID) </xsl:comment>
  1082. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  1083. <system_cache__appinfo:schema><xsl:copy-of select="."/></system_cache__appinfo:schema>
  1084. <!--@2015-10-25 - nie robimy apply template po pobraniu schematu <xsl:apply-templates mode="#current">
  1085. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  1086. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1087. <xsl:with-param name="root_name" select="$root_name"/>
  1088. <xsl:sort select="@system_cache__appinfo:sort"/>
  1089. </xsl:apply-templates>-->
  1090. </p5_tr_map:go_recurse_from_root_by_build_element_734>
  1091. </xsl:when>
  1092. <xsl:when test="local-name()='complexType' and $parent_type and $INSTANCE_ID"><!-- warunek 467 jezeli obiekt jest wyzwalany z parentem to oznacza, ze tworzymy instancje, po pierwszym sequence one sie utracaja -->
  1093. <p5_tr_map:go_recurse_from_root_by_build_element_467>
  1094. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1095. <xsl:attribute name="retrieve_ID" select="$INSTANCE_ID"/>
  1096. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1097. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/> <!-- moze miec REMOTE_ID lub nie musi, jezeli ma dzieci derewiacji -->
  1098. <xsl:attribute name="create_element" select="$parent_type"/>
  1099. <xsl:attribute name="local-name" select="local-name()"/>
  1100. <xsl:attribute name="local-name-name" select="@name"/>
  1101. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1102. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1103. <xsl:attribute name="event_type" select="467"/>
  1104. <xsl:for-each select="@*">
  1105. <xsl:choose>
  1106. <xsl:when test="substring-before(name(),':')">
  1107. <xsl:attribute name="{name()}" select="."/>
  1108. </xsl:when>
  1109. <xsl:otherwise>
  1110. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1111. </xsl:otherwise>
  1112. </xsl:choose>
  1113. </xsl:for-each>
  1114. <xsl:comment>467 tutaj beda obiekty z ID oraz type poza pierwszym? - tutaj jest tabela z instancjami obych obiektow (ComplexType) , pytamy sie o konkretny @type=$parent_type -derewiacje MAGAZYN(cT)/LOKALIZACJA(ct) </xsl:comment>
  1115. <xsl:apply-templates mode="#current">
  1116. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1117. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1118. <xsl:with-param name="root_name" select="$root_name"/>
  1119. <xsl:sort select="@system_cache__appinfo:sort"/>
  1120. </xsl:apply-templates>
  1121. </p5_tr_map:go_recurse_from_root_by_build_element_467>
  1122. </xsl:when>
  1123. <!-- simpleContent firstly instanced begin -->
  1124. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and parent::node()[local-name()='complexType'] and child::node()[local-name()='complexType'] and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') and descendant::node()/local-name()='simpleContent' )"> <!-- warunek 3941 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID -->
  1125. <p5_tr_map:go_recurse_from_root_by_build_element_3941>
  1126. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1127. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1128. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1129. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1130. <xsl:attribute name="local-name" select="local-name()"/>
  1131. <xsl:attribute name="local-name-name" select="@name"/>
  1132. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1133. <xsl:attribute name="event_type" select="3941"/>
  1134. <xsl:attribute name="comment" select="'3941 simpleContent kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1135. <xsl:variable name="system_cache__appinfo:xpath_full">
  1136. <xsl:choose>
  1137. <xsl:when test="$system_cache__appinfo:xpath_full">
  1138. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1139. </xsl:when>
  1140. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1141. </xsl:choose>
  1142. </xsl:variable>
  1143. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1144. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1145. <xsl:for-each select="@*">
  1146. <xsl:choose>
  1147. <xsl:when test="substring-before(name(),':')">
  1148. <xsl:attribute name="{name()}" select="."/>
  1149. </xsl:when>
  1150. <xsl:otherwise>
  1151. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1152. </xsl:otherwise>
  1153. </xsl:choose>
  1154. </xsl:for-each>
  1155. <xsl:apply-templates mode="#current">
  1156. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1157. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1158. <xsl:with-param name="root_name" select="$root_name"/>
  1159. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1160. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1161. <xsl:sort select="@system_cache__appinfo:sort"/>
  1162. </xsl:apply-templates>
  1163. </p5_tr_map:go_recurse_from_root_by_build_element_3941>
  1164. </xsl:when>
  1165. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and parent::node()[local-name()='complexType'] and @id and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') and descendant::node()/local-name()='simpleContent' )"> <!-- warunek 3940 simpleContent jest dodatkowa z derewiacja @type -->
  1166. <p5_tr_map:go_recurse_from_root_by_build_element_3940>
  1167. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1168. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1169. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1170. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1171. <xsl:attribute name="local-name" select="local-name()"/>
  1172. <xsl:attribute name="local-name-name" select="@name"/>
  1173. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1174. <xsl:attribute name="event_type" select="3940"/>
  1175. <xsl:attribute name="comment" select="'3940 simpleContent kolejna derewiacja w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1176. <xsl:variable name="system_cache__appinfo:xpath_full">
  1177. <xsl:choose>
  1178. <xsl:when test="$system_cache__appinfo:xpath_full">
  1179. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1180. </xsl:when>
  1181. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1182. </xsl:choose>
  1183. </xsl:variable>
  1184. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1185. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1186. <xsl:for-each select="@*">
  1187. <xsl:choose>
  1188. <xsl:when test="substring-before(name(),':')">
  1189. <xsl:attribute name="{name()}" select="."/>
  1190. </xsl:when>
  1191. <xsl:otherwise>
  1192. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1193. </xsl:otherwise>
  1194. </xsl:choose>
  1195. </xsl:for-each>
  1196. <xsl:apply-templates mode="#current">
  1197. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1198. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1199. <xsl:with-param name="root_name" select="$root_name"/>
  1200. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1201. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1202. <xsl:sort select="@system_cache__appinfo:sort"/>
  1203. </xsl:apply-templates>
  1204. </p5_tr_map:go_recurse_from_root_by_build_element_3940>
  1205. </xsl:when>
  1206. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and child::node()[local-name()='complexType'] and @id and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') and descendant::node()/local-name()='simpleContent' )"> <!-- warunek 3942 simpleContent chyba pierwsza derewiacja ktora ma ich wiecej -->
  1207. <p5_tr_map:go_recurse_from_root_by_build_element_3942>
  1208. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1209. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1210. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1211. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1212. <xsl:attribute name="local-name" select="local-name()"/>
  1213. <xsl:attribute name="local-name-name" select="@name"/>
  1214. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1215. <xsl:attribute name="event_type" select="3942"/>
  1216. <xsl:attribute name="comment" select="'3942 simpleContent pierwsza derewiacja i będą kolejne- w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1217. <xsl:variable name="system_cache__appinfo:xpath_full">
  1218. <xsl:choose>
  1219. <xsl:when test="$system_cache__appinfo:xpath_full">
  1220. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1221. </xsl:when>
  1222. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1223. </xsl:choose>
  1224. </xsl:variable>
  1225. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1226. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1227. <xsl:for-each select="@*">
  1228. <xsl:choose>
  1229. <xsl:when test="substring-before(name(),':')">
  1230. <xsl:attribute name="{name()}" select="."/>
  1231. </xsl:when>
  1232. <xsl:otherwise>
  1233. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1234. </xsl:otherwise>
  1235. </xsl:choose>
  1236. </xsl:for-each>
  1237. <xsl:apply-templates mode="#current">
  1238. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1239. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1240. <xsl:with-param name="root_name" select="$root_name"/>
  1241. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1242. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1243. <xsl:sort select="@system_cache__appinfo:sort"/>
  1244. </xsl:apply-templates>
  1245. </p5_tr_map:go_recurse_from_root_by_build_element_3942>
  1246. </xsl:when>
  1247. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and $p5_tr_map:last-type!='434d' and $p5_tr_map:last-type!='477b' and @id and ( not(descendant::node()/local-name()='sequence') and not(descendant::node()/local-name()='all') and not(descendant::node()/local-name()='choice') and descendant::node()/local-name()='simpleContent' )"> <!-- warunek 394 jedyna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID -->
  1248. <p5_tr_map:go_recurse_from_root_by_build_element_394>
  1249. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1250. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1251. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1252. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1253. <xsl:attribute name="local-name" select="local-name()"/>
  1254. <xsl:attribute name="local-name-name" select="@name"/>
  1255. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1256. <xsl:attribute name="event_type" select="394"/>
  1257. <xsl:attribute name="comment" select="'394 jedyna simpleContent derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1258. <xsl:variable name="system_cache__appinfo:xpath_full">
  1259. <xsl:choose>
  1260. <xsl:when test="$system_cache__appinfo:xpath_full">
  1261. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1262. </xsl:when>
  1263. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1264. </xsl:choose>
  1265. </xsl:variable>
  1266. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1267. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1268. <xsl:for-each select="@*">
  1269. <xsl:choose>
  1270. <xsl:when test="substring-before(name(),':')">
  1271. <xsl:attribute name="{name()}" select="."/>
  1272. </xsl:when>
  1273. <xsl:otherwise>
  1274. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1275. </xsl:otherwise>
  1276. </xsl:choose>
  1277. </xsl:for-each>
  1278. <xsl:apply-templates mode="#current">
  1279. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1280. <xsl:with-param name="parent_name" select="$parent_name"/>
  1281. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1282. <xsl:with-param name="root_name" select="$root_name"/>
  1283. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1284. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1285. <xsl:sort select="@system_cache__appinfo:sort"/>
  1286. </xsl:apply-templates>
  1287. </p5_tr_map:go_recurse_from_root_by_build_element_394>
  1288. </xsl:when>
  1289. <!-- simpleContent firstly instanced end -->
  1290. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and not(@system_cache__appinfo:only_complexContent_definition) and parent::node()[local-name()='complexType' and not(@system_cache__appinfo:only_complexContent_definition)] and child::node()[local-name()='complexType' and not(@system_cache__appinfo:only_complexContent_definition)] "> <!-- warunek 4941 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID -->
  1291. <p5_tr_map:go_recurse_from_root_by_build_element_4941>
  1292. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1293. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1294. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1295. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1296. <xsl:attribute name="local-name" select="local-name()"/>
  1297. <xsl:attribute name="local-name-name" select="@name"/>
  1298. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1299. <xsl:attribute name="event_type" select="4941"/>
  1300. <xsl:attribute name="event_type_old" select="494"/>
  1301. <xsl:variable name="system_cache__appinfo:xpath_full">
  1302. <xsl:choose>
  1303. <xsl:when test="$system_cache__appinfo:xpath_full">
  1304. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1305. </xsl:when>
  1306. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1307. </xsl:choose>
  1308. </xsl:variable>
  1309. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1310. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1311. <xsl:for-each select="@*">
  1312. <xsl:choose>
  1313. <xsl:when test="substring-before(name(),':')">
  1314. <xsl:attribute name="{name()}" select="."/>
  1315. </xsl:when>
  1316. <xsl:otherwise>
  1317. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1318. </xsl:otherwise>
  1319. </xsl:choose>
  1320. </xsl:for-each>
  1321. <xsl:comment>4941 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID </xsl:comment>
  1322. <xsl:apply-templates mode="#current">
  1323. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1324. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1325. <xsl:with-param name="root_name" select="$root_name"/>
  1326. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1327. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1328. <xsl:sort select="@system_cache__appinfo:sort"/>
  1329. </xsl:apply-templates>
  1330. </p5_tr_map:go_recurse_from_root_by_build_element_4941>
  1331. </xsl:when>
  1332. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and not(@system_cache__appinfo:only_complexContent_definition) and parent::node()[local-name()='complexType' and not(@system_cache__appinfo:only_complexContent_definition)] and @id"> <!-- warunek 4940 jest dodatkowa z derewiacja @type -->
  1333. <p5_tr_map:go_recurse_from_root_by_build_element_4940>
  1334. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1335. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1336. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1337. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1338. <xsl:attribute name="local-name" select="local-name()"/>
  1339. <xsl:attribute name="local-name-name" select="@name"/>
  1340. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1341. <xsl:attribute name="event_type" select="4940"/>
  1342. <xsl:attribute name="event_type_old" select="494"/>
  1343. <xsl:variable name="system_cache__appinfo:xpath_full">
  1344. <xsl:choose>
  1345. <xsl:when test="$system_cache__appinfo:xpath_full">
  1346. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1347. </xsl:when>
  1348. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1349. </xsl:choose>
  1350. </xsl:variable>
  1351. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1352. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1353. <xsl:for-each select="@*">
  1354. <xsl:choose>
  1355. <xsl:when test="substring-before(name(),':')">
  1356. <xsl:attribute name="{name()}" select="."/>
  1357. </xsl:when>
  1358. <xsl:otherwise>
  1359. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1360. </xsl:otherwise>
  1361. </xsl:choose>
  1362. </xsl:for-each>
  1363. <xsl:comment>4940 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID </xsl:comment>
  1364. <xsl:apply-templates mode="#current">
  1365. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1366. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1367. <xsl:with-param name="root_name" select="$root_name"/>
  1368. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1369. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1370. <xsl:sort select="@system_cache__appinfo:sort"/>
  1371. </xsl:apply-templates>
  1372. </p5_tr_map:go_recurse_from_root_by_build_element_4940>
  1373. </xsl:when>
  1374. <xsl:when test="local-name()='complexType' and not(@system_cache__appinfo:only_complexContent_definition) and $parent_type and not($INSTANCE_ID) and child::node()[local-name()='complexType' and not(@system_cache__appinfo:only_complexContent_definition)] and @id"> <!-- warunek 4942 chyba pierwsza derewiacja ktora ma ich wiecej -->
  1375. <p5_tr_map:go_recurse_from_root_by_build_element_4942>
  1376. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1377. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1378. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1379. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1380. <xsl:attribute name="local-name" select="local-name()"/>
  1381. <xsl:attribute name="local-name-name" select="@name"/>
  1382. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1383. <xsl:attribute name="event_type" select="4942"/>
  1384. <xsl:attribute name="event_type_old" select="494"/>
  1385. <xsl:variable name="system_cache__appinfo:xpath_full">
  1386. <xsl:choose>
  1387. <xsl:when test="$system_cache__appinfo:xpath_full">
  1388. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1389. </xsl:when>
  1390. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1391. </xsl:choose>
  1392. </xsl:variable>
  1393. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1394. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1395. <xsl:for-each select="@*">
  1396. <xsl:choose>
  1397. <xsl:when test="substring-before(name(),':')">
  1398. <xsl:attribute name="{name()}" select="."/>
  1399. </xsl:when>
  1400. <xsl:otherwise>
  1401. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1402. </xsl:otherwise>
  1403. </xsl:choose>
  1404. </xsl:for-each>
  1405. <xsl:comment>4940 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID </xsl:comment>
  1406. <xsl:apply-templates mode="#current">
  1407. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1408. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1409. <xsl:with-param name="root_name" select="$root_name"/>
  1410. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1411. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1412. <xsl:sort select="@system_cache__appinfo:sort"/>
  1413. </xsl:apply-templates>
  1414. </p5_tr_map:go_recurse_from_root_by_build_element_4942>
  1415. </xsl:when>
  1416. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and $p5_tr_map:last-type!='434d' and $p5_tr_map:last-type!='477b' and @id"> <!-- warunek 494 jedyna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID -->
  1417. <p5_tr_map:go_recurse_from_root_by_build_element_494>
  1418. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1419. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1420. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1421. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1422. <xsl:attribute name="local-name" select="local-name()"/>
  1423. <xsl:attribute name="local-name-name" select="@name"/>
  1424. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1425. <xsl:attribute name="event_type" select="494"/>
  1426. <xsl:attribute name="comment" select="'494 jedyna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1427. <xsl:variable name="system_cache__appinfo:xpath_full">
  1428. <xsl:choose>
  1429. <xsl:when test="$system_cache__appinfo:xpath_full">
  1430. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1431. </xsl:when>
  1432. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1433. </xsl:choose>
  1434. </xsl:variable>
  1435. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1436. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1437. <xsl:for-each select="@*">
  1438. <xsl:choose>
  1439. <xsl:when test="substring-before(name(),':')">
  1440. <xsl:attribute name="{name()}" select="."/>
  1441. </xsl:when>
  1442. <xsl:otherwise>
  1443. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1444. </xsl:otherwise>
  1445. </xsl:choose>
  1446. </xsl:for-each>
  1447. <xsl:apply-templates mode="#current">
  1448. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1449. <xsl:with-param name="parent_name" select="$parent_name"/>
  1450. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1451. <xsl:with-param name="root_name" select="$root_name"/>
  1452. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1453. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1454. <xsl:sort select="@system_cache__appinfo:sort"/>
  1455. </xsl:apply-templates>
  1456. </p5_tr_map:go_recurse_from_root_by_build_element_494>
  1457. </xsl:when>
  1458. <xsl:when test="local-name()='complexType' and $parent_type and not($INSTANCE_ID) and $p5_tr_map:last-type='434d' and @id"> <!-- warunek 494d complexType jako instancja elementu complexType bez @type - bez dziedziczen REMOTE_ID=parent::node()/ID -->
  1459. <p5_tr_map:go_recurse_from_root_by_build_element_494d>
  1460. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1461. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1462. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1463. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1464. <xsl:attribute name="local-name" select="local-name()"/>
  1465. <xsl:attribute name="local-name-name" select="@name"/>
  1466. <xsl:attribute name="parent_name" select="$parent_name"/>
  1467. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1468. <xsl:attribute name="event_type" select="'494d'"/>
  1469. <xsl:attribute name="comment" select="'494d warunek complexType jako instancja elementu complexType bez @type - bez dziedziczen REMOTE_ID=parent::node()/ID '"/>
  1470. <xsl:variable name="system_cache__appinfo:xpath_full">
  1471. <xsl:value-of select="concat(@system_cache__appinfo:prefix,':',$parent_name)"/>
  1472. </xsl:variable>
  1473. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1474. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',$parent_name)"/>
  1475. <xsl:for-each select="@*">
  1476. <xsl:choose>
  1477. <xsl:when test="substring-before(name(),':')">
  1478. <xsl:attribute name="{name()}" select="."/>
  1479. </xsl:when>
  1480. <xsl:otherwise>
  1481. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1482. </xsl:otherwise>
  1483. </xsl:choose>
  1484. </xsl:for-each>
  1485. <xsl:apply-templates mode="#current">
  1486. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1487. <xsl:with-param name="parent_name" select="$parent_name"/>
  1488. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1489. <xsl:with-param name="root_name" select="$root_name"/>
  1490. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1491. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1492. <xsl:sort select="@system_cache__appinfo:sort"/>
  1493. </xsl:apply-templates>
  1494. </p5_tr_map:go_recurse_from_root_by_build_element_494d>
  1495. </xsl:when>
  1496. <xsl:when test="local-name()='complexType' and not($parent_type) and parent::node()[local-name()='complexType'] and child::node()[local-name()='complexType']"> <!-- warunek 4811 tutaj jest tabela z dodatkowa derewiacja @type , z instancjami z dwoch stron parent:: and child::, obcych obiektow (ComplexType), pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type)-->
  1497. <p5_tr_map:go_recurse_from_root_by_build_element_4811>
  1498. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1499. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1500. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1501. <xsl:attribute name="local-name" select="local-name()"/>
  1502. <xsl:attribute name="local-name-name" select="@name"/>
  1503. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1504. <xsl:attribute name="event_type" select="4811"/>
  1505. <xsl:attribute name="parent_name" select="$parent_name"/>
  1506. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  1507. <xsl:attribute name="comment" select="'4811 tutaj jest tabela z dodatkowa derewiacja @type, z instancjami z dwoch stron parent:: and child:: , obych obiektow (ComplexType) , pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type) '"/>
  1508. <xsl:for-each select="@*">
  1509. <xsl:choose>
  1510. <xsl:when test="substring-before(name(),':')">
  1511. <xsl:attribute name="{name()}" select="."/>
  1512. </xsl:when>
  1513. <xsl:otherwise>
  1514. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1515. </xsl:otherwise>
  1516. </xsl:choose>
  1517. </xsl:for-each>
  1518. <xsl:apply-templates mode="#current">
  1519. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1520. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1521. <xsl:with-param name="root_name" select="$root_name"/>
  1522. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  1523. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  1524. <xsl:sort select="@system_cache__appinfo:sort"/>
  1525. </xsl:apply-templates>
  1526. </p5_tr_map:go_recurse_from_root_by_build_element_4811>
  1527. </xsl:when>
  1528. <xsl:when test="local-name()='complexType' and not($parent_type) and parent::node()[local-name()='complexType']"> <!-- warunek 4810 jest tabela dodatkowa z derewiacja @type, z instancjami, obcych obiektow -->
  1529. <p5_tr_map:go_recurse_from_root_by_build_element_4810>
  1530. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1531. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1532. <xsl:attribute name="local-name" select="local-name()"/>
  1533. <xsl:attribute name="local-name-name" select="@name"/>
  1534. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1535. <xsl:attribute name="event_type" select="4810"/>
  1536. <xsl:attribute name="parent_name" select="$parent_name"/>
  1537. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  1538. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1539. <xsl:attribute name="comment" select="'4810 tutaj jest tabela z dodatkowa derewiacja @type, z instancjami, obych obiektow (ComplexType) , pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type) '"/>
  1540. <xsl:for-each select="@*">
  1541. <xsl:choose>
  1542. <xsl:when test="substring-before(name(),':')">
  1543. <xsl:attribute name="{name()}" select="."/>
  1544. </xsl:when>
  1545. <xsl:otherwise>
  1546. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1547. </xsl:otherwise>
  1548. </xsl:choose>
  1549. </xsl:for-each>
  1550. <xsl:apply-templates mode="#current">
  1551. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1552. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1553. <xsl:with-param name="root_name" select="$root_name"/>
  1554. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  1555. <xsl:sort select="@system_cache__appinfo:sort"/>
  1556. </xsl:apply-templates>
  1557. </p5_tr_map:go_recurse_from_root_by_build_element_4810>
  1558. </xsl:when>
  1559. <xsl:when test="local-name()='complexType' and not($parent_type) and child::node()[local-name()='complexType']"> <!-- warunek 4812 derewiacja na child::node=complexType, z instancjami... -->
  1560. <p5_tr_map:go_recurse_from_root_by_build_element_4812>
  1561. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1562. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1563. <xsl:attribute name="local-name" select="local-name()"/>
  1564. <xsl:attribute name="local-name-name" select="@name"/>
  1565. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1566. <xsl:attribute name="event_type" select="4812"/>
  1567. <xsl:attribute name="parent_name" select="$parent_name"/>
  1568. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  1569. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1570. <xsl:attribute name="comment" select="'4812 derewiacja na child::node=complexType , z instancjami, obych obiektow (ComplexType) , pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type) '"/>
  1571. <xsl:for-each select="@*">
  1572. <xsl:choose>
  1573. <xsl:when test="substring-before(name(),':')">
  1574. <xsl:attribute name="{name()}" select="."/>
  1575. </xsl:when>
  1576. <xsl:otherwise>
  1577. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1578. </xsl:otherwise>
  1579. </xsl:choose>
  1580. </xsl:for-each>
  1581. <xsl:apply-templates mode="#current">
  1582. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1583. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1584. <xsl:with-param name="root_name" select="$root_name"/>
  1585. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  1586. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  1587. <xsl:sort select="@system_cache__appinfo:sort"/>
  1588. </xsl:apply-templates>
  1589. </p5_tr_map:go_recurse_from_root_by_build_element_4812>
  1590. </xsl:when>
  1591. <xsl:when test="local-name()='complexType' and not($parent_type)"><!-- warunek 481 tutaj wyzwolenie do znalezienia obcego obiektu z referencja z naszej strony do niego po REMOTE_ID -->
  1592. <p5_tr_map:go_recurse_from_root_by_build_element_481>
  1593. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1594. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1595. <xsl:attribute name="local-name" select="local-name()"/>
  1596. <xsl:attribute name="local-name-name" select="@name"/>
  1597. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1598. <xsl:attribute name="event_type" select="481"/>
  1599. <xsl:attribute name="parent_name" select="$parent_name"/>
  1600. <xsl:if test="$p5_tr_map:parent_type"><xsl:attribute name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/></xsl:if><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  1601. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1602. <xsl:attribute name="comment" select="'481 tutaj jest tabela z instancjami obych obiektow (ComplexType) , pytamy sie o konkretne ID=@REMOTE_ID w konkretnej tabeli (nie ma parent_type) '"/>
  1603. <xsl:for-each select="@*">
  1604. <xsl:choose>
  1605. <xsl:when test="substring-before(name(),':')">
  1606. <xsl:attribute name="{name()}" select="."/>
  1607. </xsl:when>
  1608. <xsl:otherwise>
  1609. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1610. </xsl:otherwise>
  1611. </xsl:choose>
  1612. </xsl:for-each>
  1613. <xsl:apply-templates mode="#current">
  1614. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1615. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1616. <xsl:with-param name="root_name" select="$root_name"/>
  1617. <xsl:sort select="@system_cache__appinfo:sort"/>
  1618. </xsl:apply-templates>
  1619. </p5_tr_map:go_recurse_from_root_by_build_element_481>
  1620. </xsl:when>
  1621. <!--@2016-01-17 - remuje z uwagi na blad oczekiwanego 477 do simpleContent w test_obj:klient <xsl:when test="local-name()='element' and @ref and child::node()[local-name()='element']/child::node()[local-name()='complexType']/child::node()[local-name()='simpleContent']"><!-\- warunek 1069 pobranie elementu z referencja do tabeli natywnej SE - ma @ref i musi miec REMOTE_ID -\->
  1622. <p5_tr_map:go_recurse_from_root_by_build_element_1069>
  1623. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1624. <!-\-<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>-\-><!-\- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-\->
  1625. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1626. <xsl:attribute name="local-name" select="local-name()"/>
  1627. <xsl:attribute name="local-name-name" select="@ref"/>
  1628. <xsl:attribute name="create_element" select="@ref"/>
  1629. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1630. <xsl:attribute name="event_type" select="'1069'"/>
  1631. <xsl:attribute name="event_name" select="'element[@ref]/element[@type]/complexType/simpleContent'"/>
  1632. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1633. <xsl:attribute name="comment" select="'1069 simpleContent element i type complexType with simpleContent like cT:gml:DirectPositionType '"/>
  1634. <xsl:for-each select="@*">
  1635. <xsl:choose>
  1636. <xsl:when test="substring-before(name(),':')">
  1637. <xsl:attribute name="{name()}" select="."/>
  1638. </xsl:when>
  1639. <xsl:otherwise>
  1640. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1641. </xsl:otherwise>
  1642. </xsl:choose>
  1643. </xsl:for-each>
  1644. <xsl:apply-templates mode="#current">
  1645. <!-\-<xsl:with-param name="parent_type" select="$parent_type"/>-\-> <!-\- nie ma tutaj complexType wiec nie ma instancji -\->
  1646. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1647. <xsl:with-param name="root_name" select="$root_name"/>
  1648. <xsl:sort select="@system_cache__appinfo:sort"/>
  1649. </xsl:apply-templates>
  1650. </p5_tr_map:go_recurse_from_root_by_build_element_1069>
  1651. </xsl:when>-->
  1652. <xsl:when test="(local-name()='element' ) and @ref and $p5_tr_map:check_if_targetNamespaces_for_4777_list='true'"><!-- warunek 4777 pobranie elementu z referencja do tabeli natywnej SE - ma @ref i musi miec REMOTE_ID -->
  1653. <p5_tr_map:go_recurse_from_root_by_build_element_4777>
  1654. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1655. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  1656. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1657. <xsl:attribute name="local-name" select="local-name()"/>
  1658. <xsl:attribute name="local-name-name" select="@ref"/>
  1659. <xsl:attribute name="create_element" select="@ref"/>
  1660. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1661. <xsl:attribute name="event_type" select="4777"/>
  1662. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1663. <xsl:attribute name="comment" select="'4777 (aktualizacja @prefix_for_elements) pobranie elementu z referencja do tabeli natywnej SE lub innej - ma @ref i musi miec REMOTE_ID np. MAGAZYN/sequence/default_db:TELBOXES (@ref) pasuje tez element /MAGAZYN//sequence/teryt:AdresUlica TODO element z ref nie moze miec ID '"/>
  1664. <xsl:attribute name="position" select="count(preceding-sibling::*)"/>
  1665. <xsl:variable name="system_cache__appinfo:xpath_full">
  1666. <xsl:choose>
  1667. <xsl:when test="$system_cache__appinfo:xpath_full">
  1668. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@ref)"/>
  1669. </xsl:when>
  1670. <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
  1671. </xsl:choose>
  1672. </xsl:variable>
  1673. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1674. <xsl:apply-templates mode="relation_info_from_appinfo_not_flat"/><!-- dopisanie @flat_relation_cache_name="ID" @flat_relation_cache_xpath="default_db__x3A__CRM_PROCES:CRM_PROCES/PARENT_ID" -->
  1675. <xsl:for-each select="@*">
  1676. <xsl:choose>
  1677. <xsl:when test="substring-before(name(),':')">
  1678. <xsl:attribute name="{name()}" select="."/>
  1679. </xsl:when>
  1680. <xsl:otherwise>
  1681. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1682. </xsl:otherwise>
  1683. </xsl:choose>
  1684. </xsl:for-each>
  1685. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1686. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1687. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1688. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1689. </xsl:if>
  1690. <!--<xsl:apply-templates mode="#current">
  1691. <!-\-<xsl:with-param name="parent_type" select="$parent_type"/>-\-> <!-\- nie ma tutaj complexType wiec nie ma instancji -\->
  1692. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1693. <xsl:with-param name="root_name" select="$root_name"/>
  1694. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1695. <xsl:with-param name="p5_tr_map:last-type" select="'4777'"/>
  1696. <xsl:with-param name="p5_tr_map:parent_name" select="@ref"/>
  1697. <xsl:sort select="@system_cache__appinfo:sort"/>
  1698. </xsl:apply-templates>-->
  1699. <system_cache__appinfo:schema><xsl:copy-of select="."/></system_cache__appinfo:schema>
  1700. </p5_tr_map:go_recurse_from_root_by_build_element_4777>
  1701. </xsl:when>
  1702. <xsl:when test="(local-name()='element' ) and @ref"><!-- warunek 477 pobranie elementu z referencja do tabeli nie natywnej SE - ma @ref i musi miec REMOTE_ID -->
  1703. <p5_tr_map:go_recurse_from_root_by_build_element_477>
  1704. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1705. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  1706. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1707. <xsl:attribute name="local-name" select="local-name()"/>
  1708. <xsl:attribute name="local-name-name" select="@ref"/>
  1709. <xsl:attribute name="create_element" select="@ref"/>
  1710. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1711. <xsl:attribute name="event_type" select="477"/>
  1712. <xsl:apply-templates mode="relation_info_from_appinfo_not_flat"/><!-- dopisanie @flat_relation_cache_name="ID" @flat_relation_cache_xpath="default_db__x3A__CRM_PROCES:CRM_PROCES/PARENT_ID" -->
  1713. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1714. <xsl:attribute name="comment" select="'477 (aktualizacja @prefix_for_elements) pobranie elementu z referencja do tabeli nie natywnej SE lub innej - ma @ref i musi miec REMOTE_ID np. MAGAZYN/sequence/default_db:TELBOXES (@ref) pasuje tez element /MAGAZYN//sequence/teryt:AdresUlica TODO element z ref nie moze miec ID '"/>
  1715. <xsl:variable name="system_cache__appinfo:xpath_full">
  1716. <xsl:choose>
  1717. <xsl:when test="$system_cache__appinfo:xpath_full">
  1718. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@ref)"/>
  1719. </xsl:when>
  1720. <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
  1721. </xsl:choose>
  1722. </xsl:variable>
  1723. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1724. <xsl:for-each select="@*">
  1725. <xsl:choose>
  1726. <xsl:when test="substring-before(name(),':')">
  1727. <xsl:attribute name="{name()}" select="."/>
  1728. </xsl:when>
  1729. <xsl:otherwise>
  1730. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1731. </xsl:otherwise>
  1732. </xsl:choose>
  1733. </xsl:for-each>
  1734. <xsl:variable name="p5_tr_map:detect_loop_from_build_complexType_node">
  1735. <xsl:apply-templates mode="p5_tr_map:detect_loop_from_build_complexType_node"/>
  1736. </xsl:variable>
  1737. <xsl:choose>
  1738. <xsl:when test="$p5_tr_map:detect_loop_from_build_complexType_node/p5_tr_map:detect_loop_from_build_complexType_node">
  1739. <xsl:attribute name="system_cache__appinfo:loop_name" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_name"/>
  1740. <xsl:attribute name="system_cache__appinfo:loop_id" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_id"/>
  1741. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_name_with_prefix"/>
  1742. <xsl:attribute name="p5_tr_map:detect_loop_from_build_complexType_node_comment" select="'detected loop from template p5_tr_map:detect_loop_from_build_complexType_node'"/>
  1743. </xsl:when>
  1744. <xsl:otherwise>
  1745. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1746. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1747. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1748. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1749. </xsl:if>
  1750. </xsl:otherwise>
  1751. </xsl:choose>
  1752. <xsl:apply-templates mode="#current">
  1753. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1754. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1755. <xsl:with-param name="root_name" select="$root_name"/>
  1756. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1757. <xsl:with-param name="p5_tr_map:last-type" select="'477'"/>
  1758. <xsl:with-param name="p5_tr_map:parent_name" select="@ref"/>
  1759. <xsl:sort select="@system_cache__appinfo:sort"/>
  1760. </xsl:apply-templates>
  1761. </p5_tr_map:go_recurse_from_root_by_build_element_477>
  1762. </xsl:when>
  1763. <xsl:when test="( local-name()='attribute' ) and @ref"><!-- warunek 4771 pobranie atrybutu z referencja - ma @ref i musi miec REMOTE_ID -->
  1764. <p5_tr_map:go_recurse_from_root_by_build_element_4771>
  1765. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1766. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  1767. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1768. <xsl:attribute name="local-name" select="local-name()"/>
  1769. <xsl:attribute name="local-name-name" select="@ref"/>
  1770. <xsl:attribute name="create_element" select="@ref"/>
  1771. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1772. <xsl:attribute name="event_type" select="4771"/>
  1773. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1774. <xsl:attribute name="comment" select="'4771 (aktualizacja @prefix_for_elements) pobranie atrybutu z referencja. ma @ref i musi miec REMOTE_ID '"/>
  1775. <xsl:variable name="system_cache__appinfo:xpath_full">
  1776. <xsl:choose>
  1777. <xsl:when test="$system_cache__appinfo:xpath_full">
  1778. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@ref)"/>
  1779. </xsl:when>
  1780. <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
  1781. </xsl:choose>
  1782. </xsl:variable>
  1783. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1784. <xsl:apply-templates mode="relation_info_from_appinfo_not_flat"/>
  1785. <xsl:for-each select="@*">
  1786. <xsl:choose>
  1787. <xsl:when test="substring-before(name(),':')">
  1788. <xsl:attribute name="{name()}" select="."/>
  1789. </xsl:when>
  1790. <xsl:otherwise>
  1791. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1792. </xsl:otherwise>
  1793. </xsl:choose>
  1794. </xsl:for-each>
  1795. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1796. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1797. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1798. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1799. </xsl:if>
  1800. <xsl:apply-templates mode="#current">
  1801. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1802. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1803. <xsl:with-param name="root_name" select="$root_name"/>
  1804. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1805. <xsl:with-param name="p5_tr_map:last-type" select="'4771'"/>
  1806. <xsl:with-param name="p5_tr_map:parent_name" select="@ref"/>
  1807. <xsl:sort select="@system_cache__appinfo:sort"/>
  1808. </xsl:apply-templates>
  1809. </p5_tr_map:go_recurse_from_root_by_build_element_4771>
  1810. </xsl:when>
  1811. <xsl:when test="local-name()='attribute' and @ref"><!-- warunek 549 - atrybuty z ref do innego atrybutu - opuscic do dziecka id-->
  1812. <xsl:comment>
  1813. 549 attrybuty z referencja do innego atrybutu opuscic do dziecka id: <xsl:value-of select="@id"/> </xsl:comment>
  1814. <xsl:apply-templates mode="#current">
  1815. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1816. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1817. <xsl:sort select="@system_cache__appinfo:sort"/>
  1818. </xsl:apply-templates>
  1819. </xsl:when>
  1820. <xsl:when test="( local-name()='element' ) and $parent_type and not(descendant::node()/local-name()='complexType') and ( child::node()/local-name()='simpleType' or descendant::node()/local-name()='simpleContent' ) and ( descendant::node()/local-name()!='sequence' and descendant::node()/local-name()!='all' and descendant::node()/local-name()!='choice' ) and $p5_tr_map:last-type!='477'"><!-- TODO czy ma sens!? warunek 459 (podobny do 428) element lub atrybut typu simpleType np. default_default_objects_types___d10e120614-1 - schema/complexType/seq/ELEMENT/simpleType/restriction/@base --> <!--2016-01-16 wywalone z warunku or local-name()='attribute'-->
  1821. <p5_tr_map:go_recurse_from_root_by_build_element_459>
  1822. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1823. <xsl:attribute name="local-name" select="local-name()"/>
  1824. <xsl:attribute name="local-name-name" select="@name"/>
  1825. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1826. <xsl:attribute name="event_type" select="459"/>
  1827. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1828. <xsl:attribute name="comment" select="'459 element lub atrybut typu simpleType - podobny do 381. '"/>
  1829. <xsl:for-each select="@*">
  1830. <xsl:choose>
  1831. <xsl:when test="substring-before(name(),':')">
  1832. <xsl:attribute name="{name()}" select="."/>
  1833. </xsl:when>
  1834. <xsl:otherwise>
  1835. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1836. </xsl:otherwise>
  1837. </xsl:choose>
  1838. </xsl:for-each>
  1839. <xsl:apply-templates mode="#current">
  1840. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1841. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1842. <xsl:with-param name="root_name" select="$root_name"/>
  1843. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1844. <xsl:with-param name="p5_tr_map:last-type" select="'459'"/>
  1845. <!--<xsl:with-param name="p5_tr_map:parent_type" select="@type"/>-->
  1846. <!--<xsl:with-param name="parent_type" select="@type"/>-->
  1847. <xsl:sort select="@system_cache__appinfo:sort"/>
  1848. </xsl:apply-templates>
  1849. <xsl:comment>459 to musi byc xs:simpletype - dodatkowy wyjatek w przypadku powiazanego obcego typu simpleType </xsl:comment>
  1850. </p5_tr_map:go_recurse_from_root_by_build_element_459>
  1851. </xsl:when>
  1852. <xsl:when test="( local-name()='element' ) and not($parent_type) and ( child::node()/local-name()='simpleType' or not(child::node()/*)) and @system_cache__appinfo:root_element_in_schema=true() and ( descendant::node()/local-name()!='sequence' and descendant::node()/local-name()!='all' and descendant::node()/local-name()!='choice' )"><!-- warunek 459b /schema/complexType/@ref/!_element_! bez child::* - czyli zwykly pojedynczy element w glownym schemacie do ktorego zwykle jest @ref - oznaczony w silniku schematow jako @system_cache__appinfo:root_element_in_schema='true' -->
  1853. <p5_tr_map:go_recurse_from_root_by_build_element_459b>
  1854. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1855. <xsl:attribute name="local-name" select="local-name()"/>
  1856. <xsl:attribute name="local-name-name" select="@name"/>
  1857. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1858. <xsl:attribute name="event_type" select="'459b'"/>
  1859. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1860. <xsl:attribute name="comment" select="'459b element /schema/complexType/@ref/!_element_! typu simpleType za @ref, bez simpleContent, bez przetwarzania wglab. Przetwarzanie jak w 394'"/>
  1861. <xsl:for-each select="@*">
  1862. <xsl:choose>
  1863. <xsl:when test="substring-before(name(),':')">
  1864. <xsl:attribute name="{name()}" select="."/>
  1865. </xsl:when>
  1866. <xsl:otherwise>
  1867. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1868. </xsl:otherwise>
  1869. </xsl:choose>
  1870. </xsl:for-each>
  1871. </p5_tr_map:go_recurse_from_root_by_build_element_459b>
  1872. </xsl:when>
  1873. <!--<xsl:when test="( local-name()='element' or local-name()='attribute' ) and child::node()/local-name()='simpleContent'"><!-\- warunek 1128 -\->
  1874. <p5_tr_map:go_recurse_from_root_by_build_element_1128>
  1875. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1876. <xsl:attribute name="local-name" select="local-name()"/>
  1877. <xsl:attribute name="local-name-name" select="@name"/>
  1878. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1879. <xsl:attribute name="event_type" select="1128"/>
  1880. <xsl:for-each select="@*">
  1881. <xsl:choose>
  1882. <xsl:when test="substring-before(name(),':')">
  1883. <xsl:attribute name="{name()}" select="."/>
  1884. </xsl:when>
  1885. <xsl:otherwise>
  1886. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1887. </xsl:otherwise>
  1888. </xsl:choose>
  1889. </xsl:for-each>
  1890. <xsl:comment>1128 to musi byc xs:simpletype z simpleContent dodatkowy wyjatek w przypadku powiazanego obcego typu simpleType dla atrybutu </xsl:comment>
  1891. <xsl:apply-templates mode="#current">
  1892. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1893. <xsl:with-param name="root_name" select="$root_name"/>
  1894. <xsl:sort select="@system_cache__appinfo:sort"/>
  1895. </xsl:apply-templates>
  1896. </p5_tr_map:go_recurse_from_root_by_build_element_1128>
  1897. </xsl:when>-->
  1898. <xsl:when test="local-name()='attribute' and ( empty(child::node()/element()) or child::node()/local-name()='simpleType' ) and $p5_tr_map:last-type='4771' "><!-- warunek 394-720 atrybut -->
  1899. <p5_tr_map:go_recurse_from_root_by_build_element_394-720>
  1900. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1901. <xsl:attribute name="local-name" select="local-name()"/>
  1902. <xsl:attribute name="local-name-name" select="@name"/>
  1903. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1904. <xsl:attribute name="comment" select="'394-720 pobranie wartosci atrybutu po @ref z tabeli instancja+value '"/>
  1905. <xsl:attribute name="create_element" select="@name"/>
  1906. <xsl:attribute name="event_type" select="'394-720'"/>
  1907. <xsl:variable name="system_cache__appinfo:xpath_full">
  1908. <xsl:choose>
  1909. <xsl:when test="$system_cache__appinfo:xpath_full">
  1910. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  1911. </xsl:when>
  1912. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  1913. </xsl:choose>
  1914. </xsl:variable>
  1915. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1916. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  1917. <xsl:for-each select="@*">
  1918. <xsl:choose>
  1919. <xsl:when test="substring-before(name(),':')">
  1920. <xsl:attribute name="{name()}" select="."/>
  1921. </xsl:when>
  1922. <xsl:otherwise>
  1923. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1924. </xsl:otherwise>
  1925. </xsl:choose>
  1926. </xsl:for-each>
  1927. </p5_tr_map:go_recurse_from_root_by_build_element_394-720>
  1928. </xsl:when>
  1929. <xsl:when test="local-name()='attribute' and ( empty(child::node()/element()) or child::node()/local-name()='simpleType' )"><!-- warunek 720 atrybut -->
  1930. <p5_tr_map:go_recurse_from_root_by_build_element_720>
  1931. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1932. <xsl:attribute name="local-name" select="local-name()"/>
  1933. <xsl:attribute name="local-name-name" select="@name"/>
  1934. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1935. <xsl:attribute name="comment" select="'720 pobranie wartosci atrybutu.'"/>
  1936. <xsl:attribute name="create_element" select="@name"/> <!-- @2015-06-05 bindera: nie znalazlem schematu z attrybutem aby name mialo prefix-->
  1937. <xsl:attribute name="event_type" select="720"/>
  1938. <xsl:variable name="system_cache__appinfo:xpath_full">
  1939. <xsl:choose>
  1940. <xsl:when test="$system_cache__appinfo:xpath_full">
  1941. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  1942. </xsl:when>
  1943. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  1944. </xsl:choose>
  1945. </xsl:variable>
  1946. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1947. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  1948. <xsl:for-each select="@*">
  1949. <xsl:choose>
  1950. <xsl:when test="substring-before(name(),':')">
  1951. <xsl:attribute name="{name()}" select="."/>
  1952. </xsl:when>
  1953. <xsl:otherwise>
  1954. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1955. </xsl:otherwise>
  1956. </xsl:choose>
  1957. </xsl:for-each>
  1958. </p5_tr_map:go_recurse_from_root_by_build_element_720>
  1959. </xsl:when>
  1960. <xsl:when test="local-name()='sequence' or local-name()='all' or local-name()='choice'"><!-- warunek 473 sekwencje -->
  1961. <p5_tr_map:go_recurse_from_root_by_build_element_473>
  1962. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1963. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>-->
  1964. <xsl:attribute name="retrieve_resource_id" select="@id"/>
  1965. <xsl:attribute name="local-name" select="local-name()"/>
  1966. <xsl:attribute name="event_type" select="473"/>
  1967. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1968. <xsl:attribute name="comment" select="'warunek 473 sekwencje'"/>
  1969. <xsl:for-each select="@*">
  1970. <xsl:choose>
  1971. <xsl:when test="substring-before(name(),':')">
  1972. <xsl:attribute name="{name()}" select="."/>
  1973. </xsl:when>
  1974. <xsl:otherwise>
  1975. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1976. </xsl:otherwise>
  1977. </xsl:choose>
  1978. </xsl:for-each>
  1979. <xsl:comment>473 sekwencje </xsl:comment>
  1980. <xsl:apply-templates mode="#current">
  1981. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- todo brakuje prefixu-->
  1982. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1983. <xsl:with-param name="root_name" select="$root_name"/>
  1984. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1985. <xsl:with-param name="system_cache__appinfo:xpath" select="$system_cache__appinfo:xpath"/>
  1986. <xsl:with-param name="p5_tr_map:last-type" select="'473'"/>
  1987. <xsl:sort select="@system_cache__appinfo:sort"/>
  1988. </xsl:apply-templates>
  1989. </p5_tr_map:go_recurse_from_root_by_build_element_473>
  1990. </xsl:when>
  1991. <xsl:when test="local-name()='unique'"><!-- warunek 591 klucze tymczasowo nieobslugiwane lecz nie sa bledem -->
  1992. <!--<system_cache__appinfo:go_recurse_from_root_by_build_element>
  1993. <xsl:attribute name="local-name" select="local-name()"/>
  1994. <xsl:attribute name="event_type" select="591"/>
  1995. <xsl:for-each select="@*">
  1996. <xsl:choose>
  1997. <xsl:when test="substring-before(name(),':')">
  1998. <xsl:attribute name="{name()}" select="."/>
  1999. </xsl:when>
  2000. <xsl:otherwise>
  2001. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  2002. </xsl:otherwise>
  2003. </xsl:choose>
  2004. </xsl:for-each>-->
  2005. <!--<xsl:comment>591 klucze tymczasowo nieobslugiwane lecz nie sa bledem </xsl:comment>-->
  2006. <!--</system_cache__appinfo:go_recurse_from_root_by_build_element>-->
  2007. </xsl:when>
  2008. <xsl:when test="local-name()='element' and not(child::node()[local-name()!='appinfo']/* ) "><!-- warunek 428a element pusty bez zdefiniowanego typu , bez dziecka-->
  2009. <p5_tr_map:go_recurse_from_root_by_build_element_428a>
  2010. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  2011. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--> <!-- nie ma potrzeby wskazywania na typ, bo powiazany obiekt nie jest instancyjny-->
  2012. <xsl:attribute name="local-name" select="local-name()"/>
  2013. <xsl:attribute name="local-name-name" select="@name"/>
  2014. <xsl:variable name="system_cache__appinfo:xpath_full">
  2015. <xsl:choose>
  2016. <xsl:when test="$system_cache__appinfo:xpath_full">
  2017. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  2018. </xsl:when>
  2019. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  2020. </xsl:choose>
  2021. </xsl:variable>
  2022. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  2023. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  2024. <xsl:choose>
  2025. <xsl:when test="substring-before($root_name,':')=@system_cache__appinfo:prefix"> <!-- dla lokalnego elementu prefixu nie dajemy prefixu -->
  2026. <xsl:attribute name="create_element" select="@name"/>
  2027. </xsl:when>
  2028. <xsl:otherwise>
  2029. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  2030. </xsl:otherwise>
  2031. </xsl:choose>
  2032. <xsl:attribute name="event_type" select="'428a'"/>
  2033. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  2034. <xsl:attribute name="comment" select="concat('428a - parent_name:',$root_name,' pusty element - tylko instancja')"/>
  2035. <xsl:for-each select="@*">
  2036. <xsl:choose>
  2037. <xsl:when test="substring-before(name(),':')">
  2038. <!--<xsl:attribute name="{name()}" select="."/>-->
  2039. <xsl:copy-of select="."/>
  2040. </xsl:when>
  2041. <xsl:otherwise>
  2042. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  2043. </xsl:otherwise>
  2044. </xsl:choose>
  2045. </xsl:for-each>
  2046. <xsl:comment>428a nie ma dziecka i nie ma typu - nawet simple - pobieramy element z bazy szukajac PARENT_ID - np. MAGAZYN/sequence/T_TELBOX_TYPE:xs:simple, ktory ma dane w ID, VALUE </xsl:comment>
  2047. </p5_tr_map:go_recurse_from_root_by_build_element_428a>
  2048. </xsl:when>
  2049. <!--<xsl:when test="comment()"><xsl:comment><xsl:value-of select="self::comment()"/></xsl:comment></xsl:when>-->
  2050. <xsl:when test="name()='system_cache__appinfo:loop'">
  2051. <p5_tr_map:go_recurse_from_root_by_build_element_loop>
  2052. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--> <!-- nie ma potrzeby wskazywania na typ, bo powiazany obiekt nie jest instancyjny-->
  2053. <xsl:attribute name="local-name" select="local-name()"/>
  2054. <xsl:variable name="system_cache__appinfo:xpath_full">
  2055. <xsl:choose>
  2056. <xsl:when test="$system_cache__appinfo:xpath_full">
  2057. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  2058. </xsl:when>
  2059. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  2060. </xsl:choose>
  2061. </xsl:variable>
  2062. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  2063. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  2064. <xsl:attribute name="event_type" select="'loop'"/>
  2065. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  2066. <xsl:attribute name="comment" select="concat('loop - petla ',$root_name,' ')"/>
  2067. <xsl:attribute name="root_name" select="$root_name"/>
  2068. <xsl:for-each select="@*">
  2069. <xsl:choose>
  2070. <xsl:when test="substring-before(name(),':')">
  2071. <xsl:attribute name="{name()}" select="."/>
  2072. </xsl:when>
  2073. <xsl:otherwise>
  2074. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  2075. </xsl:otherwise>
  2076. </xsl:choose>
  2077. </xsl:for-each>
  2078. <xsl:comment>loop - zapetlenie schematu wymaga osobnej instancji do obiektu zagniezdzonego </xsl:comment>
  2079. </p5_tr_map:go_recurse_from_root_by_build_element_loop>
  2080. </xsl:when>
  2081. <xsl:when test="local-name()='appinfo' or local-name()='annotation'">
  2082. <xsl:comment>#1252 appinfo supperssed there... for future transforming</xsl:comment>
  2083. </xsl:when>
  2084. <xsl:otherwise>
  2085. <xsl:if test="node()">
  2086. <p5_tr_map:go_recurse_from_root_by_build_element_592>
  2087. <xsl:attribute name="BLAD_OTHERWISE"/>
  2088. <xsl:attribute name="parent_type" select="$parent_type"/>
  2089. <xsl:attribute name="id" select="@id"/>
  2090. <xsl:attribute name="ID" select="$ID"/>
  2091. <xsl:attribute name="INSTANCE_ID" select="$INSTANCE_ID"/>
  2092. <xsl:attribute name="prefix" select="$prefix"/>
  2093. <xsl:attribute name="element_name" select="$element_name"/>
  2094. <xsl:attribute name="system_cache__appinfo:prefix" select="@system_cache__appinfo:prefix"/>
  2095. <xsl:attribute name="system_cache__appinfo:namespace_uri" select="@system_cache__appinfo:namespace_uri"/>
  2096. <xsl:attribute name="event_type" select="592"/>
  2097. <xsl:attribute name="child_node_name" select="child::node()/name()"/>
  2098. <xsl:attribute name="parent_node_name" select="parent::node()/name()"/>
  2099. <xsl:attribute name="p5_tr_map:last-type" select='$p5_tr_map:last-type'/>
  2100. <xsl:attribute name="local-name" select="local-name()"/>
  2101. <xsl:message terminate="no">592 BLAD OTHERWISE - brakujaca funkcjonalnosc w przetwarzaniu skladania obiektu:<xsl:value-of select="@id"/>; name:<xsl:value-of select="@name"/>; name():<xsl:value-of select="name()"/>;</xsl:message>
  2102. <schema>
  2103. <xsl:copy-of select="."/>
  2104. </schema>
  2105. </p5_tr_map:go_recurse_from_root_by_build_element_592>
  2106. </xsl:if>
  2107. </xsl:otherwise>
  2108. </xsl:choose>
  2109. </xsl:template>
  2110. <xsl:template match="key" mode="p5_tr_map:go_recurse_from_root_by_build_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2111. <xsl:comment>#2069 mode="p5_tr_map:go_recurse_from_root_by_build_element" match="key" - TODO to implement key features</xsl:comment>
  2112. </xsl:template>
  2113. <xsl:template match="assert" mode="p5_tr_map:go_recurse_from_root_by_build_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2114. <xsl:comment>#2141 mode="p5_tr_map:go_recurse_from_root_by_build_element" match="assert" @test=<xsl:value-of select="@test"/>; @id=<xsl:value-of select="@id"/>- TODO to implement key features</xsl:comment>
  2115. </xsl:template>
  2116. <xsl:template match="comment()|text()" mode="p5_tr_map:go_recurse_from_root_by_build_element"/>
  2117. <xsl:template match="comment()|text()" mode="p5_tr_map:go_recurse_from_root_by_build_complexType"/>
  2118. <!-- @2016-02-03 template do wykrycia glownie z wezla 477 czy pod nim nie jest loop z kawalkiem instancji -->
  2119. <xsl:template match="element" mode="p5_tr_map:detect_loop_from_build_complexType_node" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2120. <xsl:choose>
  2121. <xsl:when test="@ref"/>
  2122. <xsl:otherwise>
  2123. <xsl:comment>#2058 pass element @id:<xsl:value-of select="@id"/></xsl:comment>
  2124. <xsl:apply-templates mode="#current"/>
  2125. </xsl:otherwise>
  2126. </xsl:choose>
  2127. </xsl:template>
  2128. <xsl:template match="complexType" mode="p5_tr_map:detect_loop_from_build_complexType_node" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2129. <xsl:comment>#2063 pass complexType @id:<xsl:value-of select="@id"/></xsl:comment>
  2130. <xsl:apply-templates mode="#current"/>
  2131. </xsl:template>
  2132. <xsl:template match="system_cache__appinfo:loop" mode="p5_tr_map:detect_loop_from_build_complexType_node">
  2133. <xsl:element name="p5_tr_map:detect_loop_from_build_complexType_node">
  2134. <xsl:attribute name="system_cache__appinfo:loop_name" select="@name"/>
  2135. <xsl:attribute name="system_cache__appinfo:loop_id" select="@id"/>
  2136. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="@name_with_prefix"/>
  2137. <xsl:attribute name="comment" select="'child nodes analyzed - there is loop'"/>
  2138. </xsl:element>
  2139. </xsl:template>
  2140. <!--<xsl:template match="text()|comment()" mode="p5_tr_map:detect_loop_from_build_complexType_node"/>-->
  2141. <!-- @2017-03-06 bindera: dla potrzeb silnika ant i usprawnienia odbudowania refow w plaskiej bazie -->
  2142. <xsl:template mode="relation_info_from_appinfo_not_flat" match="annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2143. <xsl:apply-templates mode="relation_info_from_appinfo_not_flat"/>
  2144. </xsl:template>
  2145. <xsl:template mode="relation_info_from_appinfo_not_flat" match="appinfo" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2146. <xsl:for-each select="system_cache__appinfo:flat_relation_cache/system_cache__appinfo:source">
  2147. <xsl:attribute name="flat_relation_cache_name" select="@system_cache__appinfo:name"/>
  2148. <xsl:attribute name="flat_relation_cache_xpath" select="@system_cache__appinfo:xpath"/>
  2149. </xsl:for-each>
  2150. </xsl:template>
  2151. <xsl:template mode="relation_info_from_appinfo_not_flat" match="*|text()|comment()"/>
  2152. <xsl:template name="p5_tr_map:detect_first_ref_to_native_procesy5_table"><!-- @2015-09-30 ten template lepiej wykrywa pierwszy element relacji do cachujacej tabeli procesy5 -->
  2153. <xsl:param name="native_procesy5_table_prefix" select="'default_db'"/>
  2154. <xsl:param name="p5_tr_map:go_recurse_from_root_by_build_element" required="yes"/>
  2155. <xsl:variable name="detect_first_ref_to_native_procesy5_table_multi">
  2156. <xsl:apply-templates mode="p5_tr_map:detect_first_ref_to_native_procesy5_table_multi" select="$p5_tr_map:go_recurse_from_root_by_build_element">
  2157. <xsl:with-param name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>
  2158. </xsl:apply-templates>
  2159. </xsl:variable>
  2160. <!--<temp_to_parse>
  2161. <xsl:copy-of select="$detect_first_ref_to_native_procesy5_table_multi"></xsl:copy-of>
  2162. </temp_to_parse>-->
  2163. <xsl:for-each select="$detect_first_ref_to_native_procesy5_table_multi/*[1]">
  2164. <xsl:element name="{name()}">
  2165. <xsl:for-each select="@*">
  2166. <xsl:attribute name="{name()}" select="."/>
  2167. </xsl:for-each>
  2168. </xsl:element>
  2169. </xsl:for-each>
  2170. <!--<xsl:copy-of select="$detect_first_ref_to_native_procesy5_table_multi/*[position()=1]"/>-->
  2171. </xsl:template>
  2172. <xsl:template match="*" mode="p5_tr_map:detect_first_ref_to_native_procesy5_table_multi" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2173. <xsl:param name="native_procesy5_table_prefix" select="'default_db'"/>
  2174. <xsl:param name="trigger_event477_used"/> <!-- trigger do template aby tylko jeden raz byl przetwarzany ref typu 477 i wiecej -->
  2175. <xsl:choose>
  2176. <xsl:when test="@event_type='481'">
  2177. <xsl:if test="$debug_level&gt;3"><xsl:comment>3148: event=481 @event_type:<xsl:value-of select="@event_type"/>; @id:<xsl:value-of select="@system_cache__appinfo:id"/>;</xsl:comment></xsl:if>
  2178. </xsl:when>
  2179. <xsl:when test=" (@event_type='477' or @event_type='477b' )and not(substring-before(@system_cache__appinfo:ref,':')=$native_procesy5_table_prefix)">
  2180. <xsl:if test="$debug_level&gt;3"><xsl:comment>3099: event=477 and not substring(@ref,prefix) @event_type:<xsl:value-of select="@event_type"/>; @id:<xsl:value-of select="@system_cache__appinfo:id"/>;</xsl:comment></xsl:if>
  2181. </xsl:when>
  2182. <xsl:when test=" (@event_type='4777' ) "> <!--@2016-01-20 po dodaniu typu 4777 jest konkret and substring-before(@system_cache__appinfo:ref,':')=$native_procesy5_table_prefix -->
  2183. <xsl:if test="$debug_level&gt;3"><xsl:comment>3099: event=477 and substring(@ref,prefix) @event_type:<xsl:value-of select="@event_type"/>; @id:<xsl:value-of select="@system_cache__appinfo:id"/>;</xsl:comment></xsl:if>
  2184. <xsl:element name="system_cache__appinfo:detect_first_ref_to_native_procesy5_table">
  2185. <xsl:attribute name="event_type" select="@event_type"/>
  2186. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:ref"/>
  2187. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2188. <xsl:attribute name="p5_tr_map:uuid" select="@p5_tr_map:uuid"/>
  2189. <!--<xsl:attribute name="substring-before" select="substring-before(@system_cache__appinfo:ref,':')"/>
  2190. <xsl:attribute name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>-->
  2191. </xsl:element>
  2192. </xsl:when>
  2193. <xsl:when test="not($trigger_event477_used) and ( @event_type='477' or @event_type='477b' ) ">
  2194. <xsl:if test="$debug_level&gt;3"><xsl:comment>3099: not(trigger) and @event=477 @event_type:<xsl:value-of select="@event_type"/>; @id:<xsl:value-of select="@system_cache__appinfo:id"/>;</xsl:comment></xsl:if>
  2195. <xsl:apply-templates mode="#current">
  2196. <xsl:with-param name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>
  2197. <xsl:with-param name="trigger_event477_used" select="1"/>
  2198. </xsl:apply-templates>
  2199. </xsl:when>
  2200. <xsl:when test="not($trigger_event477_used)">
  2201. <xsl:if test="$debug_level&gt;3"><xsl:comment>3099: not(trigger), @event_type:<xsl:value-of select="@event_type"/>; @id:<xsl:value-of select="@system_cache__appinfo:id"/>;</xsl:comment></xsl:if>
  2202. <xsl:apply-templates mode="#current">
  2203. <xsl:with-param name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>
  2204. </xsl:apply-templates>
  2205. </xsl:when>
  2206. <xsl:otherwise/>
  2207. </xsl:choose>
  2208. </xsl:template>
  2209. <!-- @2015-09-25 template do znalezienia z jakimi tabelami plaskimi procesy5 dany element ma relacje
  2210. na wejsciu system_cache__appinfo:go_recurse_from_root_by_build_element-->
  2211. <xsl:template name="p5_tr_map:detect_element_relations_to_objects">
  2212. <xsl:param name="system_cache__appinfo:detect_root_sequence_id" required="no"/>
  2213. <xsl:param name="p5_tr_map:go_recurse_from_root_by_build_element" required="no"/>
  2214. <xsl:apply-templates mode="p5_tr_map:detect_element_relations_to_objects" select="$p5_tr_map:go_recurse_from_root_by_build_element"/>
  2215. <!-- //node()[@system_cache__appinfo:id=$system_cache__appinfo:detect_root_sequence_id//@id]/*-->
  2216. <!--<xsl:apply-templates mode="system_cache__appinfo:detect_element_relations_to_objects" select="$system_cache__appinfo:go_recurse_from_root_by_build_element//node()[@id=$system_cache__appinfo:detect_root_sequence_id/system_cache__appinfo:detect_root_sequence_id/@id]"/>-->
  2217. </xsl:template>
  2218. <!-- to be used by template name="system_cache__appinfo:go_recurse_from_root_by_build_element"-->
  2219. <xsl:template match="*" mode="p5_tr_map:detect_element_relations_to_objects" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2220. <xsl:param name="p5_tr_map:relation_after_derivation"/>
  2221. <xsl:param name="p5_tr_map:ancestor-count" select="1"/>
  2222. <xsl:choose>
  2223. <xsl:when test="@event_type='434' or @event_type='434d' ">
  2224. <xsl:apply-templates mode="#current">
  2225. <xsl:with-param name="p5_tr_map:relation_after_derivation" select="$p5_tr_map:relation_after_derivation"/>
  2226. </xsl:apply-templates>
  2227. </xsl:when>
  2228. <xsl:when test="@event_type='4940' or @event_type='4941' ">
  2229. <xsl:apply-templates mode="#current">
  2230. <xsl:with-param name="p5_tr_map:relation_after_derivation" select="true()"/>
  2231. <xsl:with-param name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count + 1"/>
  2232. </xsl:apply-templates>
  2233. </xsl:when>
  2234. <xsl:when test="@event_type='494' or @event_type='4942' or @event_type='494d' ">
  2235. <xsl:apply-templates mode="#current">
  2236. <xsl:with-param name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count + 1"/>
  2237. </xsl:apply-templates>
  2238. </xsl:when>
  2239. <xsl:when test="@event_type='473'">
  2240. <xsl:apply-templates mode="#current">
  2241. <xsl:with-param name="p5_tr_map:relation_after_derivation" select="$p5_tr_map:relation_after_derivation"/>
  2242. <xsl:with-param name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count + 1"/>
  2243. </xsl:apply-templates>
  2244. </xsl:when>
  2245. <xsl:when test="@event_type='477'">
  2246. <xsl:element name="system_cache__appinfo:detect_element_relations_to_objects">
  2247. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:ref"/>
  2248. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2249. <xsl:attribute name="system_cache__appinfo:event_type" select="@event_type"/>
  2250. <xsl:attribute name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count"/>
  2251. <xsl:if test="$p5_tr_map:relation_after_derivation"><xsl:attribute name="p5_tr_map:relation_after_derivation" select="$p5_tr_map:relation_after_derivation"/></xsl:if>
  2252. </xsl:element>
  2253. </xsl:when>
  2254. <!--<xsl:when test="@event_type='4771'">@2016-01-20 todo attributes na ref
  2255. <xsl:element name="system_cache__appinfo:detect_element_relations_to_objects">
  2256. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:ref"/>
  2257. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2258. </xsl:element>
  2259. </xsl:when>-->
  2260. <xsl:when test="@event_type='477b'">
  2261. <xsl:element name="system_cache__appinfo:detect_element_relations_to_objects">
  2262. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:type"/>
  2263. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2264. <xsl:attribute name="system_cache__appinfo:event_type" select="@event_type"/>
  2265. <xsl:attribute name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count"/>
  2266. <xsl:if test="$p5_tr_map:relation_after_derivation"><xsl:attribute name="p5_tr_map:relation_after_derivation" select="$p5_tr_map:relation_after_derivation"/></xsl:if>
  2267. </xsl:element>
  2268. </xsl:when>
  2269. <!--<xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2270. <xsl:apply-templates mode="#current"/>
  2271. </xsl:when>-->
  2272. </xsl:choose>
  2273. </xsl:template>
  2274. <!--<xsl:template match="comment()|text()" mode="p5_tr_map:detect_element_relations_to_objects" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"/>-->
  2275. <!-- testowo template do wykorzystywania przy generowaniu konfigow relacji do wykrycia jaki jest bazowy complexType przywiazany do tabeli Procesy5
  2276. @2015-10-25 pokazuje blednie 2 rekordy, wiec zamieniamy na pokazanie ostatniego elementu z derewiacji
  2277. nie dziala produkcyjnie system_cache__appinfo:trigger_on_insert itp.. -->
  2278. <xsl:template match="p5_tr_map:go_recurse_from_root_by_build_element" mode="p5_tr_map:detect_parent_complexType_with_ref_to_procesy5_table" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2279. <xsl:variable name="system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table">
  2280. <xsl:apply-templates mode="p5_tr_map:detect_parent_complexType_with_ref_to_procesy5_table_multi" select="current()"/>
  2281. </xsl:variable>
  2282. <!--<xsl:comment>3126:<xsl:value-of select="count($system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table/system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table)"/></xsl:comment>-->
  2283. <xsl:for-each select="$system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table/system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table[count($system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table/system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table)]">
  2284. <xsl:copy-of select="."/>
  2285. </xsl:for-each>
  2286. </xsl:template>
  2287. <!--<xsl:template match="go_recurse_from_root_by_build_element" mode="#all" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2288. <xsl:message>#2293 TODO modify mode from #all to directed mode! in mode </xsl:message>
  2289. <xsl:apply-templates mode="#current"/>
  2290. </xsl:template>-->
  2291. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:detect_element_local_elements_without_ref_elements" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2292. <!--<xsl:message>#2335 Matched element</xsl:message>-->
  2293. <xsl:apply-templates mode="#current"/>
  2294. </xsl:template>
  2295. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:detect_element_relations_to_objects" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2296. <xsl:apply-templates mode="#current">
  2297. <xsl:with-param name="p5_tr_map:ancestor-count" select="1"/>
  2298. </xsl:apply-templates>
  2299. </xsl:template>
  2300. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:detect_first_ref_to_native_procesy5_table_multi" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2301. <xsl:apply-templates mode="#current"/>
  2302. </xsl:template>
  2303. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:detect_loop_from_build_complexType_node" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2304. <xsl:apply-templates mode="#current"/>
  2305. </xsl:template>
  2306. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:detect_parent_complexType_with_ref_to_procesy5_table_multi" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2307. <xsl:apply-templates mode="#current"/>
  2308. </xsl:template>
  2309. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:detect_root_sequence_id" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2310. <xsl:apply-templates mode="#current"/>
  2311. </xsl:template>
  2312. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:element_complexType_tr_map" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2313. <xsl:apply-templates mode="#current"/>
  2314. </xsl:template>
  2315. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:generate_validate_config_for_php_javascript" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2316. <xsl:apply-templates mode="#current"/>
  2317. </xsl:template>
  2318. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:go_recurse_from_root_by_build_complexType" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2319. <xsl:apply-templates mode="#current"/>
  2320. </xsl:template>
  2321. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:go_recurse_from_root_by_build_element" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2322. <xsl:apply-templates mode="#current"/>
  2323. </xsl:template>
  2324. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:objects_derivations" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2325. <!--<xsl:message>#2372 matched <xsl:value-of select="@event_type"/></xsl:message>-->
  2326. <xsl:apply-templates mode="#current"/>
  2327. </xsl:template>
  2328. <xsl:template match="go_recurse_from_root_by_build_element" mode="p5_tr_map:objects_derivations_attrs" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2329. <xsl:apply-templates mode="#current"/>
  2330. </xsl:template>
  2331. <xsl:template match="go_recurse_from_root_by_build_element" mode="relation_info_from_appinfo_not_flat" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2332. <xsl:apply-templates mode="#current"/>
  2333. </xsl:template>
  2334. <xsl:template match="go_recurse_from_root_by_build_element" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2335. <xsl:apply-templates mode="#current"/>
  2336. </xsl:template>
  2337. <xsl:template match="*" mode="p5_tr_map:detect_parent_complexType_with_ref_to_procesy5_table_multi" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2338. <xsl:choose>
  2339. <xsl:when test="*">
  2340. <xsl:choose>
  2341. <xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2342. <xsl:comment>#1404 element go_recurse_from_root_by_build_element</xsl:comment>
  2343. <xsl:apply-templates mode="#current"/>
  2344. </xsl:when>
  2345. <xsl:when test="@event_type='434'">
  2346. <xsl:apply-templates mode="#current"/>
  2347. </xsl:when>
  2348. <xsl:when test="@event_type='710'">
  2349. <xsl:apply-templates mode="#current"/>
  2350. </xsl:when>
  2351. <xsl:when test="@event_type='494' or @event_type='4940'"> <!-- przed 2016-01-02 and not(child::node()/attribute::node()[local-name()='event_type']='494') -->
  2352. <xsl:element name="system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table">
  2353. <xsl:comment>#2417 @e<xsl:value-of select="@event_type"/>; </xsl:comment><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@system_cache__appinfo:name)"/></xsl:element>
  2354. <xsl:variable name="current" select="."/>
  2355. <xsl:for-each select="*[@event_type='473']">
  2356. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2357. <xsl:attribute name="event_type_to" select="$current/@event_type"/>
  2358. <xsl:attribute name="event_type" select="@event_type"/>
  2359. <xsl:attribute name="comment" select="'pierwszy warunek 494 bez dziecka 494'"/>
  2360. <xsl:element name="from_table">
  2361. <xsl:attribute name="table" select="@system_cache__appinfo:id"/>
  2362. <xsl:attribute name="src_desc" select="concat(@local-name,',',@system_cache__appinfo:name,',',@local-name-name)"/>
  2363. <xsl:attribute name="field_read" select="'ID'"/>
  2364. </xsl:element>
  2365. <xsl:element name="to_table">
  2366. <xsl:attribute name="name" select="$current/@system_cache__appinfo:id"/>
  2367. <xsl:attribute name="dst_desc" select="concat($current/@local-name,',',$current/@system_cache__appinfo:name,',',$current/@local-name-name)"/>
  2368. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2369. </xsl:element>
  2370. </xsl:element>
  2371. </xsl:for-each>
  2372. <xsl:apply-templates mode="#current"/>
  2373. </xsl:when>
  2374. <xsl:when test="@event_type='4941' or @event_type='4942'">
  2375. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2376. <xsl:attribute name="event_type_to" select="child::node()/@event_type"/>
  2377. <xsl:attribute name="event_type" select="@event_type"/>
  2378. <xsl:attribute name="comment" select="'drugi warunek 494 samo'"/>
  2379. <xsl:element name="from_table">
  2380. <xsl:attribute name="table" select="child::node()/@system_cache__appinfo:id"/>
  2381. <xsl:attribute name="src_desc" select="child::node()/@system_cache__appinfo:name"/>
  2382. <xsl:attribute name="field_read" select="'ID'"/>
  2383. </xsl:element>
  2384. <xsl:element name="to_table">
  2385. <xsl:attribute name="name" select="@system_cache__appinfo:id"/>
  2386. <xsl:attribute name="dst_desc" select="@system_cache__appinfo:name"/>
  2387. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2388. </xsl:element>
  2389. </xsl:element>
  2390. <xsl:apply-templates mode="#current"/>
  2391. </xsl:when>
  2392. <xsl:when test="@event_type='473' or @event_type='481' or @event_type='4810'">
  2393. <xsl:variable name="current" select="."/>
  2394. <xsl:for-each select="*[@event_type='477' or @event_type='477b']">
  2395. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2396. <xsl:attribute name="event_type_to" select="$current/@event_type"/>
  2397. <xsl:attribute name="event_type" select="@event_type"/>
  2398. <xsl:attribute name="comment" select="'trzeci warunek 473 lub 481 w petli'"/>
  2399. <xsl:element name="from_table">
  2400. <xsl:attribute name="table" select="@system_cache__appinfo:id"/>
  2401. <xsl:attribute name="src_desc" select="concat(@local-name,',',@system_cache__appinfo:name,',',@local-name-name)"/>
  2402. <xsl:attribute name="field_read" select="'ID'"/>
  2403. </xsl:element>
  2404. <xsl:element name="to_table">
  2405. <xsl:attribute name="name" select="$current/@system_cache__appinfo:id"/>
  2406. <xsl:attribute name="dst_desc" select="concat($current/@local-name,',',$current/@system_cache__appinfo:name,',',$current/@local-name-name)"/>
  2407. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2408. </xsl:element>
  2409. <xsl:variable name="current3023" select="."/>
  2410. <xsl:for-each select="*[@event_type='434']/system_cache__appinfo:go_recurse_from_root_by_build_element[@event_type='734']">
  2411. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2412. <xsl:attribute name="event_type_to" select="$current/@event_type"/>
  2413. <xsl:attribute name="event_type" select="@event_type"/>
  2414. <xsl:attribute name="comment" select="'zagniezdzony do trzeciego warunek poszukiwania natywnej tabeli procesy5 w petli'"/>
  2415. <xsl:element name="from_table">
  2416. <xsl:attribute name="table" select="concat(@system_cache__appinfo:prefix,':',@system_cache__appinfo:name)"/>
  2417. <xsl:attribute name="src_desc" select="concat(@local-name,',',@system_cache__appinfo:name,',',@local-name-name)"/>
  2418. <xsl:attribute name="field_read" select="'ID'"/>
  2419. </xsl:element>
  2420. <xsl:element name="to_table">
  2421. <xsl:attribute name="name" select="$current3023/@system_cache__appinfo:id"/>
  2422. <xsl:attribute name="dst_desc" select="concat($current3023/@local-name,',',$current3023/@system_cache__appinfo:name,',',$current3023/@local-name-name)"/>
  2423. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2424. </xsl:element>
  2425. </xsl:element>
  2426. </xsl:for-each>
  2427. </xsl:element>
  2428. </xsl:for-each>
  2429. </xsl:when>
  2430. </xsl:choose>
  2431. </xsl:when>
  2432. <xsl:otherwise><xsl:comment>#1489 other</xsl:comment></xsl:otherwise>
  2433. </xsl:choose>
  2434. </xsl:template>
  2435. <!-- @2015-04-23 template do stworzenia tabel dla obiektu na podstawie schematu obiektu - tabele instancyjne oraz z ID,PARENT_ID,REMOTE_ID -->
  2436. <!--@2016-01-20 rem na rzecz sso...xsl <xsl:template match="*" mode="p5_tr_map:create_sql_tables_from_go_recurse_from_root_by_build_element" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2437. <xsl:choose>
  2438. <xsl:when test="@event_type='477' or @event_type='477b'">
  2439. <!-\- <xsl:element name="sql_create_table">
  2440. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2441. CREATE TABLE IF NOT EXISTS `<xsl:value-of select="@system_cache__appinfo:id"/>` (`ID` int(11) NOT NULL AUTO_INCREMENT , `PARENT_ID` int(11), `REMOTE_ID` int(11), PRIMARY KEY (`ID`), KEY `REMOTE_ID` (`REMOTE_ID`), KEY `PARENT_ID`(`PARENT_ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin2 ;
  2442. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`,`REMOTE_ID`) values (0,0,0);-\->
  2443. <!-\-</xsl:element>-\->
  2444. </xsl:when>
  2445. <xsl:when test="@event_type='459b'">
  2446. <!-\- <xsl:element name="sql_create_table">
  2447. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2448. CREATE TABLE IF NOT EXISTS `<xsl:value-of select="@system_cache__appinfo:id"/>` (`ID` int(11) NOT NULL AUTO_INCREMENT, `VALUE` varchar(255) , PRIMARY KEY (`ID`), KEY `VALUE` (`VALUE`)) ENGINE=MyISAM DEFAULT CHARSET=latin2 ;
  2449. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`) values (0,0);-\->
  2450. <!-\-</xsl:element>-\->
  2451. </xsl:when>
  2452. <xsl:when test="@retrieve_TYPE or @requested-table-type='INSTANCE' and @system_cache__appinfo:id ">
  2453. <!-\- <xsl:element name="sql_create_table">
  2454. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2455. CREATE TABLE IF NOT EXISTS `<xsl:value-of select="@system_cache__appinfo:id"/>` (`ID` int(11) NOT NULL AUTO_INCREMENT,`TYPE` varchar(255) NOT NULL , `REMOTE_ID` int(11), PRIMARY KEY (`ID`), KEY `TYPE` (`TYPE`) , KEY `REMOTE_ID` (`REMOTE_ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin2 ;
  2456. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`REMOTE_ID`) values (0,0);-\->
  2457. <!-\-</xsl:element>-\->
  2458. </xsl:when>
  2459. <xsl:when test="@system_cache__appinfo:id and @create_element and ( @local-name='element' or @local-name='attribute')">
  2460. <!-\- <xsl:element name="sql_create_table">
  2461. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2462. CREATE TABLE IF NOT EXISTS `<xsl:value-of select="@system_cache__appinfo:id"/>` (`ID` int(11) NOT NULL AUTO_INCREMENT,`PARENT_ID` int(11) , `VALUE` varchar(255) , PRIMARY KEY (`ID`), KEY `PARENT_ID` (`PARENT_ID`) , KEY `VALUE` (`VALUE`)) ENGINE=MyISAM DEFAULT CHARSET=latin2 ;
  2463. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`) values (0,0);-\->
  2464. <!-\-</xsl:element>-\->
  2465. </xsl:when>
  2466. <xsl:when test="@retrieve_REMOTE_ID and @system_cache__appinfo:id">
  2467. <!-\- <xsl:element name="sql_create_table">
  2468. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2469. CREATE TABLE IF NOT EXISTS `<xsl:value-of select="@system_cache__appinfo:id"/>` (`ID` int(11) NOT NULL AUTO_INCREMENT , `PARENT_ID` int(11), `REMOTE_ID` int(11), PRIMARY KEY (`ID`), KEY `REMOTE_ID` (`REMOTE_ID`), KEY `PARENT_ID`(`PARENT_ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin2 ;
  2470. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`,`REMOTE_ID`) values (0,0,0);-\->
  2471. <!-\-</xsl:element>-\->
  2472. </xsl:when>
  2473. <xsl:when test="(@retrieve_ID or @retrieve_PARENT_ID) and @system_cache__appinfo:id">
  2474. <!-\- <xsl:element name="sql_create_table">
  2475. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2476. CREATE TABLE IF NOT EXISTS `<xsl:value-of select="@system_cache__appinfo:id"/>` (`ID` int(11) NOT NULL AUTO_INCREMENT,`PARENT_ID` int(11) , PRIMARY KEY (`ID`), KEY `PARENT_ID` (`PARENT_ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin2 ;
  2477. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`) values (0,0);-\->
  2478. <!-\-</xsl:element>-\->
  2479. </xsl:when>
  2480. <xsl:when test="not(@*)"></xsl:when>
  2481. <xsl:otherwise>
  2482. <xsl:element name="ERROR_ELSE">
  2483. <xsl:for-each select="@*">
  2484. <xsl:attribute name="{name()}" select="."/>
  2485. </xsl:for-each>
  2486. <!-\-<xsl:copy-of select="."/>-\->
  2487. </xsl:element>
  2488. </xsl:otherwise>
  2489. </xsl:choose>
  2490. <xsl:apply-templates mode="#current"/>
  2491. </xsl:template>-->
  2492. <!-- @2015-09-25 template do znalezienia root sequence id - np. dla OBSZAR jest to OBSZAR/LOKALIZACJA
  2493. na wejsciu system_cache__appinfo:go_recurse_from_root_by_build_element. Poprawiono dla sciezki terc:WOJ 434d/494d/473 -->
  2494. <xsl:template match="*" mode="p5_tr_map:detect_root_sequence_id" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2495. <xsl:choose>
  2496. <xsl:when test="(@event_type='494' or @event_type='4940' or @event_type='494d' ) and ( child::node()[@event_type='473'] )"><!-- przed 2016-01-02 and not(child::node()/attribute::node()[local-name()='event_type']='494') -->
  2497. <xsl:element name="system_cache__appinfo:detect_root_sequence_id">
  2498. <xsl:attribute name="id" select="*[@event_type='473']/@system_cache__appinfo:id" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"/>
  2499. </xsl:element>
  2500. </xsl:when>
  2501. <xsl:when test="@event_type='434' or @event_type='434d' or @event_type='434er'">
  2502. <xsl:apply-templates mode="#current"/>
  2503. </xsl:when>
  2504. <xsl:when test="@event_type='4941' or @event_type='4942'">
  2505. <xsl:apply-templates mode="#current"/>
  2506. </xsl:when>
  2507. <xsl:when test="@event_type='710'">
  2508. <xsl:apply-templates mode="#current"/>
  2509. </xsl:when>
  2510. <xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2511. <xsl:apply-templates mode="#current"/>
  2512. </xsl:when>
  2513. </xsl:choose>
  2514. </xsl:template>
  2515. <xsl:template mode="p5_tr_map:detect_root_sequence_id" match="@*"/>
  2516. <!-- @2015-09-30 template do wykrycia lokalnych elementow prostych z danego obiektu ComplexType, bez elementow z referencji innych obiektow, zwlaszcza do wykrycia lokalnych powiazan z plaska tabela, odbudowuje z system_cache__appinfo:go_recurse_from_root_by_build_element -->
  2517. <xsl:template match="*" mode="p5_tr_map:detect_element_local_elements_without_ref_elements" exclude-result-prefixes="#all" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2518. <!--<xsl:message>#2567 Matched element <xsl:value-of select="name()"/> with @event_type=<xsl:value-of select="@event_type"/></xsl:message>-->
  2519. <xsl:choose>
  2520. <xsl:when test="@event_type='434' or @event_type='434d' or @event_type='494' or @event_type='4941' or @event_type='4942' or @event_type='4940' or @event_type='473'">
  2521. <xsl:element name="system_cache__appinfo:detect_element_local_elements_without_ref_elements">
  2522. <xsl:for-each select="@*">
  2523. <xsl:attribute name="{name()}" select="."/>
  2524. </xsl:for-each>
  2525. <xsl:apply-templates mode="#current"/>
  2526. </xsl:element>
  2527. </xsl:when>
  2528. <xsl:when test="@event_type='428' or @event_type='428a' or @event_type='459'">
  2529. <xsl:element name="system_cache__appinfo:detect_element_local_elements_without_ref_elements">
  2530. <xsl:for-each select="@*">
  2531. <xsl:attribute name="{name()}" select="."/>
  2532. </xsl:for-each>
  2533. <xsl:apply-templates mode="#current"/>
  2534. </xsl:element>
  2535. </xsl:when>
  2536. <xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2537. <xsl:apply-templates mode="#current"/>
  2538. </xsl:when>
  2539. </xsl:choose>
  2540. </xsl:template>
  2541. <!-- @2015-11-26 bindera: funkcja do zastapienia system_cache__appinfo:objects_parent_relation w celu wyswietlenia prawidlowej sekwencji derewiacji -->
  2542. <xsl:template match="*" mode="p5_tr_map:objects_derivations" exclude-result-prefixes="#all" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2543. <xsl:message>#2602 DEBUG matched name()=<xsl:value-of select="name()"/>; @event_type=<xsl:value-of select="@event_type"/>;</xsl:message>
  2544. <xsl:choose>
  2545. <xsl:when test="@event_type='434' or @event_type='434d' or @event_type='434er'">
  2546. <xsl:apply-templates mode="#current"/>
  2547. </xsl:when>
  2548. <xsl:when test="@event_type='494' or @event_type='4941' or @event_type='4942' or @event_type='4940' or @event_type='494d' or @event_type='394' or @event_type='3941' or @event_type='3942' or @event_type='3940'">
  2549. <xsl:element name="p5_tr_map:derivations">
  2550. <xsl:apply-templates mode="p5_tr_map:objects_derivations_attrs" select="@*"/>
  2551. </xsl:element>
  2552. <xsl:apply-templates mode="#current"/>
  2553. </xsl:when>
  2554. </xsl:choose>
  2555. </xsl:template>
  2556. <xsl:template match="@system_cache__appinfo:name|@system_cache__appinfo:id|@local-name" mode="p5_tr_map:objects_derivations_attrs">
  2557. <xsl:attribute name="{name()}" select="."/>
  2558. </xsl:template>
  2559. <xsl:template match="@system_cache__appinfo:prefix" mode="p5_tr_map:objects_derivations_attrs">
  2560. <xsl:attribute name="{name()}" select="."/>
  2561. <xsl:attribute name="p5_tr_map:name_with_pref" select="concat(.,':',../@system_cache__appinfo:name)"/>
  2562. <xsl:attribute name="system_cache__appinfo:xpath_full" select="../@system_cache__appinfo:xpath_full"/>
  2563. </xsl:template>
  2564. <xsl:template match="@*" mode="p5_tr_map:objects_derivations_attrs"/>
  2565. <!-- @2015-10-20 template do wygenerowania na podstawie plaskich struktur w obiekcie zaglebionych wylacznie wramach sequence/choice (a wiec nie zaglebionych) do wygenerowania prostego parsowalnego konfiga do walidatora w javascript/php ,
  2566. bazuje na template @mode=system_cache__appinfo:empty_element_from_xsd_form -->
  2567. <xsl:template match="*" mode="p5_tr_map:generate_validate_config_for_php_javascript" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd">
  2568. <xsl:param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" required="no"/>
  2569. <xsl:param name="parent_choice_name"/><!-- do oznaczania w przypadku choice aby dzieci mialy wspolne name -->
  2570. <xsl:variable name="node_3406" select="."/>
  2571. <!-- tutaj dajemy
  2572. <system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table>
  2573. <system_cache__appinfo:flat_element-to-object_element system_cache__appinfo:flat_element="ID"
  2574. system_cache__appinfo:object_element="ID"
  2575. system_cache__appinfo:id="default_default_objects_types___d20e438-id"
  2576. system_cache__appinfo:xpath="default_default_objects_types:LOKALIZACJA/ID"/>
  2577. />
  2578. -->
  2579. <xsl:choose>
  2580. <xsl:when test="@event_type='992'">
  2581. 992</xsl:when>
  2582. <xsl:when test="@event_type='467'"> <!-- element instancyjny -->
  2583. <xsl:apply-templates mode="#current">
  2584. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2585. <xsl:with-param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table"/>
  2586. </xsl:apply-templates>
  2587. </xsl:when>
  2588. <xsl:when test="@event_type='4812'"> <!-- element instancyjny - kilka dereviacji, ta jest pierwsza -->
  2589. <xsl:text>&#xa;</xsl:text><xsl:value-of select="concat(@parent_name,'[',system_cache__appinfo:schema_occurs_max_sequence(@system_cache__appinfo:minOccurs),'][',system_cache__appinfo:schema_occurs_max_sequence(@system_cache__appinfo:maxOccurs),']')"/>{
  2590. <xsl:apply-templates mode="#current">
  2591. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2592. <xsl:with-param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table"/>
  2593. </xsl:apply-templates>
  2594. }
  2595. </xsl:when>
  2596. <xsl:when test="@event_type='1069'"> <!-- element instancyjny - z ref / simpleContent -->
  2597. <xsl:apply-templates mode="#current">
  2598. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2599. <xsl:with-param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table"/>
  2600. </xsl:apply-templates>
  2601. </xsl:when>
  2602. <xsl:when test="@event_type='459b'"> <!-- element instancyjny - z ref / simpleContent -->
  2603. 459b
  2604. </xsl:when>
  2605. <xsl:when test="@event_type='477' or @event_type='477b'">
  2606. <xsl:text>&#xa;</xsl:text><xsl:value-of select="concat(@system_cache__appinfo:ref,'[',system_cache__appinfo:schema_occurs_max_sequence(@system_cache__appinfo:minOccurs),'][',system_cache__appinfo:schema_occurs_max_sequence(@system_cache__appinfo:maxOccurs),']')"/>,</xsl:when>
  2607. <xsl:when test="@event_type='428'"> <!-- simple type -->
  2608. <!--428 @system_cache__appinfo:id:<xsl:value-of select="@system_cache__appinfo:id"/>-->
  2609. <xsl:for-each select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table/system_cache__appinfo:flat_element-to-object_element">
  2610. <!-- 3447,<xsl:value-of select="@system_cache__appinfo:xpath"/>-<xsl:value-of select="$node_3406/@system_cache__appinfo:xpath"/>-->
  2611. <xsl:if test="$node_3406/@system_cache__appinfo:xpath=@system_cache__appinfo:xpath"> <!-- $node_3406/@system_cache__appinfo:xpath= -->
  2612. <xsl:text>&#xa;</xsl:text><xsl:value-of select="concat($node_3406/@local-name-name,'[',system_cache__appinfo:schema_occurs_max_sequence($node_3406/@system_cache__appinfo:minOccurs),'][',system_cache__appinfo:schema_occurs_max_sequence($node_3406/@system_cache__appinfo:maxOccurs),']')"/>,<xsl:value-of select="' '"/>
  2613. </xsl:if>
  2614. </xsl:for-each>
  2615. </xsl:when>
  2616. <xsl:when test="@event_type='720'"><xsl:text>&#xa;</xsl:text>@<xsl:value-of select="@local-name-name"/>, </xsl:when>
  2617. <xsl:when test="@event_type='734'"> <!-- natywna tabela plaska np. default_db-->
  2618. // 734 natywna tabela plaska np. default_db
  2619. </xsl:when>
  2620. <xsl:when test="@event_type='473' and @local-name='choice'"> <!-- choice -->
  2621. <xsl:variable name="parent_choice_name" select="generate-id()"/>
  2622. <!--<input type="radio" name="{$parent_choice_name}" value="{$parent_choice_name}"></input>-->
  2623. <xsl:text>&#xa;</xsl:text>choice:<xsl:value-of select="@retrieve_resource_id"/>{
  2624. <xsl:apply-templates mode="#current">
  2625. <xsl:with-param name="parent_choice_name" select="@system_cache__appinfo:id"/>
  2626. <xsl:with-param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table"/>
  2627. </xsl:apply-templates> }
  2628. </xsl:when>
  2629. <xsl:when test="@event_type='473' and @local-name!='choice'"> <!-- sequence -->
  2630. <xsl:text>&#xa;</xsl:text>sequence:<xsl:value-of select="@retrieve_resource_id"/>{
  2631. <xsl:apply-templates mode="#current">
  2632. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2633. <xsl:with-param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table"/>
  2634. </xsl:apply-templates> }
  2635. </xsl:when>
  2636. <xsl:otherwise>
  2637. <!--<font size="-3">Otherwise @event_type:<xsl:value-of select="@event_type"/>;@system_cache__appinfo:id:<xsl:value-of select="@system_cache__appinfo:id"/></font>-->
  2638. <xsl:apply-templates mode="#current">
  2639. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2640. <xsl:with-param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table"/>
  2641. </xsl:apply-templates>
  2642. </xsl:otherwise>
  2643. </xsl:choose>
  2644. </xsl:template>
  2645. <xsl:template match="comment()|text()" mode="#all"/>
  2646. </xsl:stylesheet>