p5_tr_map.xsl 223 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731
  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:apply-templates mode="#current">
  468. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie potrzeba dla takiego przypadku juz przekazywac typu instancji -->
  469. <xsl:with-param name="ID" select="$ID"/>
  470. <xsl:with-param name="root_name" select="$root_name"/>
  471. <xsl:sort select="@system_cache__appinfo:sort"/>
  472. </xsl:apply-templates>
  473. </p5_tr_map:go_recurse_from_root_by_build_element_436>
  474. </xsl:when>
  475. <!-- simpleContent after refferred begin -->
  476. <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)-->
  477. <p5_tr_map:go_recurse_from_root_by_build_element_3811>
  478. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  479. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  480. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  481. <xsl:attribute name="local-name" select="local-name()"/>
  482. <xsl:attribute name="local-name-name" select="@name"/>
  483. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  484. <xsl:attribute name="event_type" select="3811"/>
  485. <xsl:attribute name="parent_name" select="$parent_name"/>
  486. <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-->
  487. <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) '"/>
  488. <xsl:for-each select="@*">
  489. <xsl:choose>
  490. <xsl:when test="substring-before(name(),':')">
  491. <xsl:attribute name="{name()}" select="."/>
  492. </xsl:when>
  493. <xsl:otherwise>
  494. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  495. </xsl:otherwise>
  496. </xsl:choose>
  497. </xsl:for-each>
  498. <xsl:apply-templates mode="#current">
  499. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  500. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  501. <xsl:with-param name="root_name" select="$root_name"/>
  502. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  503. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  504. <xsl:sort select="@system_cache__appinfo:sort"/>
  505. </xsl:apply-templates>
  506. </p5_tr_map:go_recurse_from_root_by_build_element_3811>
  507. </xsl:when>
  508. <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 -->
  509. <p5_tr_map:go_recurse_from_root_by_build_element_3810>
  510. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  511. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  512. <xsl:attribute name="local-name" select="local-name()"/>
  513. <xsl:attribute name="local-name-name" select="@name"/>
  514. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  515. <xsl:attribute name="event_type" select="3810"/>
  516. <xsl:attribute name="parent_name" select="$parent_name"/>
  517. <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-->
  518. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  519. <xsl:attribute name="comment" select="'warunek 3810 dla simpleContent jest tabela dodatkowa z derewiacja @type, z instancjami, obcych obiektow'"/>
  520. <xsl:for-each select="@*">
  521. <xsl:choose>
  522. <xsl:when test="substring-before(name(),':')">
  523. <xsl:attribute name="{name()}" select="."/>
  524. </xsl:when>
  525. <xsl:otherwise>
  526. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  527. </xsl:otherwise>
  528. </xsl:choose>
  529. </xsl:for-each>
  530. <xsl:apply-templates mode="#current">
  531. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  532. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  533. <xsl:with-param name="root_name" select="$root_name"/>
  534. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  535. <xsl:sort select="@system_cache__appinfo:sort"/>
  536. </xsl:apply-templates>
  537. </p5_tr_map:go_recurse_from_root_by_build_element_3810>
  538. </xsl:when>
  539. <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... -->
  540. <p5_tr_map:go_recurse_from_root_by_build_element_3812>
  541. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  542. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  543. <xsl:attribute name="local-name" select="local-name()"/>
  544. <xsl:attribute name="local-name-name" select="@name"/>
  545. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  546. <xsl:attribute name="event_type" select="3812"/>
  547. <xsl:attribute name="parent_name" select="$parent_name"/>
  548. <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-->
  549. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  550. <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) '"/>
  551. <xsl:for-each select="@*">
  552. <xsl:choose>
  553. <xsl:when test="substring-before(name(),':')">
  554. <xsl:attribute name="{name()}" select="."/>
  555. </xsl:when>
  556. <xsl:otherwise>
  557. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  558. </xsl:otherwise>
  559. </xsl:choose>
  560. </xsl:for-each>
  561. <xsl:apply-templates mode="#current">
  562. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  563. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  564. <xsl:with-param name="root_name" select="$root_name"/>
  565. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  566. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  567. <xsl:sort select="@system_cache__appinfo:sort"/>
  568. </xsl:apply-templates>
  569. </p5_tr_map:go_recurse_from_root_by_build_element_3812>
  570. </xsl:when>
  571. <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 -->
  572. <p5_tr_map:go_recurse_from_root_by_build_element_381>
  573. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  574. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  575. <xsl:attribute name="local-name" select="local-name()"/>
  576. <xsl:attribute name="local-name-name" select="@name"/>
  577. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  578. <xsl:attribute name="event_type" select="'381'"/>
  579. <xsl:attribute name="parent_name" select="$parent_name"/>
  580. <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-->
  581. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  582. <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) '"/>
  583. <xsl:for-each select="@*">
  584. <xsl:choose>
  585. <xsl:when test="substring-before(name(),':')">
  586. <xsl:attribute name="{name()}" select="."/>
  587. </xsl:when>
  588. <xsl:otherwise>
  589. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  590. </xsl:otherwise>
  591. </xsl:choose>
  592. </xsl:for-each>
  593. <xsl:apply-templates mode="#current">
  594. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  595. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  596. <xsl:with-param name="root_name" select="$root_name"/>
  597. <xsl:with-param name="p5_tr_map:last-type" select="'381'"/>
  598. <xsl:sort select="@system_cache__appinfo:sort"/>
  599. </xsl:apply-templates>
  600. </p5_tr_map:go_recurse_from_root_by_build_element_381>
  601. </xsl:when>
  602. <!-- simpleContent after refferred end -->
  603. <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 -->
  604. <p5_tr_map:go_recurse_from_root_by_build_element_428>
  605. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  606. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  607. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--> <!-- nie ma potrzeby wskazywania na typ, bo powiazany obiekt nie jest instancyjny-->
  608. <xsl:attribute name="local-name" select="local-name()"/>
  609. <xsl:attribute name="local-name-name" select="@name"/>
  610. <xsl:variable name="system_cache__appinfo:xpath_full">
  611. <xsl:choose>
  612. <xsl:when test="$system_cache__appinfo:xpath_full">
  613. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  614. </xsl:when>
  615. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  616. </xsl:choose>
  617. </xsl:variable>
  618. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  619. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  620. <xsl:choose>
  621. <xsl:when test="substring-before($root_name,':')=@system_cache__appinfo:prefix"> <!-- dla lokalnego elementu prefixu nie dajemy prefixu -->
  622. <xsl:attribute name="create_element" select="@name"/>
  623. </xsl:when>
  624. <xsl:otherwise>
  625. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  626. </xsl:otherwise>
  627. </xsl:choose>
  628. <xsl:attribute name="event_type" select="428"/>
  629. <xsl:attribute name="comment" select="concat('428 - parent_name:',$root_name)"/>
  630. <xsl:for-each select="@*">
  631. <xsl:choose>
  632. <xsl:when test="substring-before(name(),':')">
  633. <xsl:attribute name="{name()}" select="."/>
  634. </xsl:when>
  635. <xsl:otherwise>
  636. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  637. </xsl:otherwise>
  638. </xsl:choose>
  639. </xsl:for-each>
  640. <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>
  641. </p5_tr_map:go_recurse_from_root_by_build_element_428>
  642. </xsl:when>
  643. <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 -->
  644. <p5_tr_map:go_recurse_from_root_by_build_element_434>
  645. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  646. <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')"/>
  647. <xsl:attribute name="event_type" select="434"/>
  648. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  649. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  650. <xsl:attribute name="parent_type" select="$parent_type"/>
  651. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  652. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  653. <xsl:choose>
  654. <xsl:when test="$parent_name">
  655. <xsl:apply-templates mode="#current">
  656. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  657. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  658. <xsl:with-param name="parent_name" select="$parent_name"/>
  659. <xsl:with-param name="root_name" select="$root_name"/>
  660. <xsl:sort select="@system_cache__appinfo:sort"/>
  661. </xsl:apply-templates>
  662. </xsl:when>
  663. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  664. <xsl:apply-templates mode="#current">
  665. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  666. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  667. <xsl:with-param name="parent_name" select="@name"/>
  668. <xsl:with-param name="root_name" select="$root_name"/>
  669. <xsl:sort select="@system_cache__appinfo:sort"/>
  670. </xsl:apply-templates>
  671. </xsl:otherwise>
  672. </xsl:choose>
  673. </p5_tr_map:go_recurse_from_root_by_build_element_434>
  674. </xsl:when>
  675. <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 ) -->
  676. <!--<p5_tr_map:go_recurse_from_root_by_build_element_434b>
  677. <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')"/>
  678. <xsl:attribute name="event_type" select="'434b'"/>
  679. <xsl:attribute name="event_name" select="'element[]/complexType'"/>
  680. <xsl:attribute name="id" select="@id"/>
  681. <xsl:choose>
  682. <xsl:when test="$parent_name">
  683. <xsl:apply-templates mode="#current">
  684. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  685. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  686. <xsl:with-param name="parent_name" select="$parent_name"/>
  687. <xsl:with-param name="root_name" select="$root_name"/>
  688. <xsl:sort select="@system_cache__appinfo:sort"/>
  689. </xsl:apply-templates>
  690. </xsl:when>
  691. <xsl:otherwise><!-\- wymuszamy parent_type jak go nie ma za pierwszym razem -\->
  692. <xsl:apply-templates mode="#current">
  693. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  694. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  695. <xsl:with-param name="parent_name" select="@name"/>
  696. <xsl:with-param name="root_name" select="$root_name"/>
  697. <xsl:sort select="@system_cache__appinfo:sort"/>
  698. </xsl:apply-templates>
  699. </xsl:otherwise>
  700. </xsl:choose>
  701. </p5_tr_map:go_recurse_from_root_by_build_element_434b>-->
  702. <p5_tr_map:go_recurse_from_root_by_build_element_473b>
  703. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  704. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  705. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>-->
  706. <xsl:attribute name="retrieve_resource_id" select="@id"/>
  707. <xsl:attribute name="local-name" select="local-name()"/>
  708. <xsl:attribute name="event_type" select="'473b'"/>
  709. <xsl:attribute name="comment" select="'warunek 473b element complexType z dowiazanymi innymi elementami/atrybutami - do traktowania podobnie jak sekwencje @2016-05 todo'"/>
  710. <xsl:for-each select="@*">
  711. <xsl:choose>
  712. <xsl:when test="substring-before(name(),':')">
  713. <xsl:attribute name="{name()}" select="."/>
  714. </xsl:when>
  715. <xsl:otherwise>
  716. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  717. </xsl:otherwise>
  718. </xsl:choose>
  719. </xsl:for-each>
  720. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  721. <xsl:comment>warunek 473b element complexType z dowiazanymi innymi elementami/atrybutami - do traktowania podobnie jak sekwencje @2016-05 todo </xsl:comment>
  722. <xsl:apply-templates mode="#current">
  723. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- todo brakuje prefixu-->
  724. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  725. <xsl:with-param name="root_name" select="$root_name"/>
  726. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  727. <xsl:with-param name="system_cache__appinfo:xpath" select="$system_cache__appinfo:xpath"/>
  728. <xsl:with-param name="p5_tr_map:last-type" select="'473'"/>
  729. <xsl:sort select="@system_cache__appinfo:sort"/>
  730. </xsl:apply-templates>
  731. </p5_tr_map:go_recurse_from_root_by_build_element_473b>
  732. </xsl:when>
  733. <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 ) -->
  734. <p5_tr_map:go_recurse_from_root_by_build_element_434b>
  735. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  736. <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')"/>
  737. <xsl:attribute name="event_type" select="'434b'"/>
  738. <xsl:attribute name="event_name" select="'element[]/complexType'"/>
  739. <xsl:attribute name="id" select="@id"/>
  740. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  741. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  742. <!--<xsl:attribute name="parent_name" select="$parent_name"/>-->
  743. <xsl:choose>
  744. <xsl:when test="$parent_name">
  745. <xsl:apply-templates mode="#current">
  746. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  747. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  748. <xsl:with-param name="parent_name" select="$parent_name"/>
  749. <xsl:with-param name="root_name" select="$root_name"/>
  750. <xsl:sort select="@system_cache__appinfo:sort"/>
  751. </xsl:apply-templates>
  752. </xsl:when>
  753. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  754. <xsl:apply-templates mode="#current">
  755. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  756. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  757. <xsl:with-param name="parent_name" select="@name"/>
  758. <xsl:with-param name="root_name" select="$root_name"/>
  759. <xsl:sort select="@system_cache__appinfo:sort"/>
  760. </xsl:apply-templates>
  761. </xsl:otherwise>
  762. </xsl:choose>
  763. </p5_tr_map:go_recurse_from_root_by_build_element_434b>
  764. </xsl:when>
  765. <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 -->
  766. <p5_tr_map:go_recurse_from_root_by_build_element_434n>
  767. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  768. <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')"/>
  769. <xsl:attribute name="event_type" select="'434n'"/>
  770. <!--<xsl:attribute name="system_cache__appinfo:id" select="@id"/>-->
  771. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  772. <xsl:attribute name="parent_type" select="$parent_type"/>
  773. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  774. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  775. <xsl:choose>
  776. <xsl:when test="$parent_name">
  777. <xsl:apply-templates mode="#current">
  778. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  779. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  780. <xsl:with-param name="parent_name" select="$parent_name"/>
  781. <xsl:with-param name="root_name" select="$root_name"/>
  782. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  783. <xsl:with-param name="p5_tr_map:last-type" select="'434n'"/>
  784. <xsl:sort select="@system_cache__appinfo:sort"/>
  785. </xsl:apply-templates>
  786. </xsl:when>
  787. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  788. <xsl:apply-templates mode="#current">
  789. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  790. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  791. <xsl:with-param name="parent_name" select="@name"/>
  792. <xsl:with-param name="root_name" select="$root_name"/>
  793. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  794. <xsl:with-param name="p5_tr_map:last-type" select="'434n'"/>
  795. <xsl:sort select="@system_cache__appinfo:sort"/>
  796. </xsl:apply-templates>
  797. </xsl:otherwise>
  798. </xsl:choose>
  799. </p5_tr_map:go_recurse_from_root_by_build_element_434n>
  800. </xsl:when>
  801. <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 -->
  802. <p5_tr_map:go_recurse_from_root_by_build_element_434nt>
  803. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  804. <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')"/>
  805. <xsl:attribute name="event_type" select="'434nt'"/>
  806. <!--<xsl:attribute name="system_cache__appinfo:id" select="@id"/>-->
  807. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  808. <xsl:attribute name="parent_type" select="$parent_type"/>
  809. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  810. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  811. <xsl:choose>
  812. <xsl:when test="$parent_name">
  813. <xsl:apply-templates mode="#current">
  814. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  815. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  816. <xsl:with-param name="parent_name" select="$parent_name"/>
  817. <xsl:with-param name="root_name" select="$root_name"/>
  818. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  819. <xsl:with-param name="p5_tr_map:last-type" select="'434n'"/>
  820. <xsl:sort select="@system_cache__appinfo:sort"/>
  821. </xsl:apply-templates>
  822. </xsl:when>
  823. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  824. <xsl:apply-templates mode="#current">
  825. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  826. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  827. <xsl:with-param name="parent_name" select="@name"/>
  828. <xsl:with-param name="root_name" select="$root_name"/>
  829. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  830. <xsl:with-param name="p5_tr_map:last-type" select="'434nt'"/>
  831. <xsl:sort select="@system_cache__appinfo:sort"/>
  832. </xsl:apply-templates>
  833. </xsl:otherwise>
  834. </xsl:choose>
  835. </p5_tr_map:go_recurse_from_root_by_build_element_434nt>
  836. </xsl:when>
  837. <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 -->
  838. <p5_tr_map:go_recurse_from_root_by_build_element_434c>
  839. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  840. <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')"/>
  841. <xsl:attribute name="event_type" select="'434c'"/>
  842. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  843. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  844. <xsl:attribute name="parent_type" select="$parent_type"/>
  845. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  846. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  847. <xsl:choose>
  848. <xsl:when test="$parent_name">
  849. <xsl:apply-templates mode="#current">
  850. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  851. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  852. <xsl:with-param name="parent_name" select="$parent_name"/>
  853. <xsl:with-param name="root_name" select="$root_name"/>
  854. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  855. <xsl:sort select="@system_cache__appinfo:sort"/>
  856. </xsl:apply-templates>
  857. </xsl:when>
  858. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  859. <xsl:apply-templates mode="#current">
  860. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  861. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  862. <xsl:with-param name="parent_name" select="@name"/>
  863. <xsl:with-param name="root_name" select="$root_name"/>
  864. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  865. <xsl:sort select="@system_cache__appinfo:sort"/>
  866. </xsl:apply-templates>
  867. </xsl:otherwise>
  868. </xsl:choose>
  869. </p5_tr_map:go_recurse_from_root_by_build_element_434c>
  870. </xsl:when>
  871. <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 -->
  872. <p5_tr_map:go_recurse_from_root_by_build_element_434d>
  873. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  874. <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')"/>
  875. <xsl:attribute name="event_type" select="'434d'"/>
  876. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  877. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  878. <xsl:attribute name="parent_type" select="$parent_type"/>
  879. <xsl:attribute name="system_cache__appinfo:name" select="@name"/>
  880. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  881. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  882. <xsl:choose>
  883. <!--<xsl:when test="$parent_name">
  884. <xsl:apply-templates mode="#current">
  885. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  886. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  887. <xsl:with-param name="parent_name" select="$parent_name"/>
  888. <xsl:with-param name="root_name" select="$root_name"/>
  889. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  890. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  891. <xsl:sort select="@system_cache__appinfo:sort"/>
  892. </xsl:apply-templates>
  893. </xsl:when>-->
  894. <xsl:when test="1=2"/>
  895. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  896. <xsl:apply-templates mode="#current">
  897. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  898. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  899. <xsl:with-param name="parent_name" select="@name"/>
  900. <xsl:with-param name="root_name" select="$root_name"/>
  901. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  902. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  903. <xsl:sort select="@system_cache__appinfo:sort"/>
  904. </xsl:apply-templates>
  905. </xsl:otherwise>
  906. </xsl:choose>
  907. </p5_tr_map:go_recurse_from_root_by_build_element_434d>
  908. </xsl:when>
  909. <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 -->
  910. <p5_tr_map:go_recurse_from_root_by_build_element_434er>
  911. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  912. <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')"/>
  913. <xsl:attribute name="event_type" select="'434er'"/>
  914. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  915. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  916. <xsl:attribute name="parent_type" select="$parent_type"/>
  917. <xsl:attribute name="system_cache__appinfo:name" select="@name"/>
  918. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  919. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  920. <xsl:choose>
  921. <!--<xsl:when test="$parent_name">
  922. <xsl:apply-templates mode="#current">
  923. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  924. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  925. <xsl:with-param name="parent_name" select="$parent_name"/>
  926. <xsl:with-param name="root_name" select="$root_name"/>
  927. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  928. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  929. <xsl:sort select="@system_cache__appinfo:sort"/>
  930. </xsl:apply-templates>
  931. </xsl:when>-->
  932. <xsl:when test="1=2"/>
  933. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  934. <xsl:apply-templates mode="#current">
  935. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  936. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  937. <xsl:with-param name="parent_name" select="@name"/>
  938. <xsl:with-param name="root_name" select="$root_name"/>
  939. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  940. <xsl:with-param name="p5_tr_map:last-type" select="'434er'"/>
  941. <xsl:sort select="@system_cache__appinfo:sort"/>
  942. </xsl:apply-templates>
  943. </xsl:otherwise>
  944. </xsl:choose>
  945. </p5_tr_map:go_recurse_from_root_by_build_element_434er>
  946. </xsl:when>
  947. <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 -->
  948. <p5_tr_map:go_recurse_from_root_by_build_element_434r>
  949. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  950. <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')"/>
  951. <xsl:attribute name="event_type" select="'434r'"/>
  952. <xsl:attribute name="system_cache__appinfo:id" select="@id"/>
  953. <xsl:attribute name="event_name" select="'element[@type]/node()'"/>
  954. <xsl:attribute name="parent_type" select="$parent_type"/>
  955. <xsl:attribute name="system_cache__appinfo:name" select="@name"/>
  956. <xsl:copy-of select="@system_cache__appinfo:namespace_uri"/>
  957. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  958. <xsl:choose>
  959. <!--<xsl:when test="$parent_name">
  960. <xsl:apply-templates mode="#current">
  961. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  962. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  963. <xsl:with-param name="parent_name" select="$parent_name"/>
  964. <xsl:with-param name="root_name" select="$root_name"/>
  965. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  966. <xsl:with-param name="p5_tr_map:last-type" select="'434d'"/>
  967. <xsl:sort select="@system_cache__appinfo:sort"/>
  968. </xsl:apply-templates>
  969. </xsl:when>-->
  970. <xsl:when test="1=2"/>
  971. <xsl:otherwise><!-- wymuszamy parent_type jak go nie ma za pierwszym razem -->
  972. <xsl:apply-templates mode="#current">
  973. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  974. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  975. <xsl:with-param name="parent_name" select="@name"/>
  976. <xsl:with-param name="root_name" select="$root_name"/>
  977. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  978. <xsl:with-param name="p5_tr_map:last-type" select="'434r'"/>
  979. <xsl:sort select="@system_cache__appinfo:sort"/>
  980. </xsl:apply-templates>
  981. </xsl:otherwise>
  982. </xsl:choose>
  983. </p5_tr_map:go_recurse_from_root_by_build_element_434r>
  984. </xsl:when>
  985. <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 -->
  986. <p5_tr_map:go_recurse_from_root_by_build_element_477b>
  987. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  988. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  989. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  990. <xsl:attribute name="local-name" select="local-name()"/>
  991. <xsl:attribute name="local-name-name" select="@name"/>
  992. <xsl:attribute name="create_element" select="@name"/>
  993. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  994. <xsl:attribute name="event_type" select="'477b'"/>
  995. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  996. <xsl:attribute name="comment" select="'477b uzyty ComplexType bez @ref w elemencie - symulacja pobrania elementu jak z @ref i musi miec REMOTE_ID'"/>
  997. <xsl:variable name="system_cache__appinfo:xpath_full">
  998. <xsl:choose>
  999. <xsl:when test="$system_cache__appinfo:xpath_full">
  1000. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@type)"/>
  1001. </xsl:when>
  1002. <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
  1003. </xsl:choose>
  1004. </xsl:variable>
  1005. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1006. <xsl:for-each select="@*">
  1007. <xsl:choose>
  1008. <xsl:when test="substring-before(name(),':')">
  1009. <xsl:attribute name="{name()}" select="."/>
  1010. </xsl:when>
  1011. <xsl:otherwise>
  1012. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1013. </xsl:otherwise>
  1014. </xsl:choose>
  1015. </xsl:for-each>
  1016. <xsl:variable name="p5_tr_map:detect_loop_from_build_complexType_node">
  1017. <xsl:apply-templates mode="p5_tr_map:detect_loop_from_build_complexType_node"/>
  1018. </xsl:variable>
  1019. <xsl:choose>
  1020. <xsl:when test="$p5_tr_map:detect_loop_from_build_complexType_node/p5_tr_map:detect_loop_from_build_complexType_node">
  1021. <xsl:attribute name="system_cache__appinfo:loop_name" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_name"/>
  1022. <xsl:attribute name="system_cache__appinfo:loop_id" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_id"/>
  1023. <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"/>
  1024. <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'"/>
  1025. </xsl:when>
  1026. <xsl:otherwise>
  1027. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1028. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1029. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1030. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1031. </xsl:if>
  1032. </xsl:otherwise>
  1033. </xsl:choose>
  1034. <xsl:apply-templates mode="#current">
  1035. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1036. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1037. <xsl:with-param name="root_name" select="$root_name"/>
  1038. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1039. <xsl:with-param name="p5_tr_map:last-type" select="'477b'"/>
  1040. <xsl:with-param name="p5_tr_map:parent_type" select="@type"/>
  1041. <!--<xsl:with-param name="parent_type" select="@type"/>-->
  1042. <xsl:sort select="@system_cache__appinfo:sort"/>
  1043. </xsl:apply-templates>
  1044. </p5_tr_map:go_recurse_from_root_by_build_element_477b>
  1045. </xsl:when>
  1046. <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) -->
  1047. <p5_tr_map:go_recurse_from_root_by_build_element_710>
  1048. <xsl:attribute name="event_type" select="710"/>
  1049. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1050. <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)')"/>
  1051. <xsl:apply-templates mode="#current">
  1052. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1053. <xsl:with-param name="INSTANCE_ID" select="$INSTANCE_ID"/>
  1054. <xsl:with-param name="root_name" select="$root_name"/>
  1055. <xsl:sort select="@system_cache__appinfo:sort"/>
  1056. </xsl:apply-templates>
  1057. </p5_tr_map:go_recurse_from_root_by_build_element_710>
  1058. </xsl:when>
  1059. <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 -->
  1060. <p5_tr_map:go_recurse_from_root_by_build_element_734>
  1061. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1062. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!--nie potrzeba oczekiwanego typu - zaciagamy rekord z ID-->
  1063. <xsl:attribute name="local-name" select="local-name()"/>
  1064. <xsl:attribute name="local-name-name" select="@name"/>
  1065. <xsl:attribute name="copy-retrieved-element" select="'*'"/> <!-- nalezy skopiowac cala zawartosc sciagnietego elementu XML z api -->
  1066. <xsl:attribute name="event_type" select="734"/>
  1067. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1068. <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)'"/>
  1069. <xsl:for-each select="@*">
  1070. <xsl:choose>
  1071. <xsl:when test="substring-before(name(),':')">
  1072. <xsl:attribute name="{name()}" select="."/>
  1073. </xsl:when>
  1074. <xsl:otherwise>
  1075. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1076. </xsl:otherwise>
  1077. </xsl:choose>
  1078. </xsl:for-each>
  1079. <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>
  1080. <xsl:copy-of select="appinfo//@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" copy-namespaces="no"/>
  1081. <system_cache__appinfo:schema><xsl:copy-of select="."/></system_cache__appinfo:schema>
  1082. <!--@2015-10-25 - nie robimy apply template po pobraniu schematu <xsl:apply-templates mode="#current">
  1083. <xsl:with-param name="parent_type" select="$parent_type"/> <!-\- todo brakuje prefixu-\->
  1084. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1085. <xsl:with-param name="root_name" select="$root_name"/>
  1086. <xsl:sort select="@system_cache__appinfo:sort"/>
  1087. </xsl:apply-templates>-->
  1088. </p5_tr_map:go_recurse_from_root_by_build_element_734>
  1089. </xsl:when>
  1090. <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 -->
  1091. <p5_tr_map:go_recurse_from_root_by_build_element_467>
  1092. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1093. <xsl:attribute name="retrieve_ID" select="$INSTANCE_ID"/>
  1094. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1095. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/> <!-- moze miec REMOTE_ID lub nie musi, jezeli ma dzieci derewiacji -->
  1096. <xsl:attribute name="create_element" select="$parent_type"/>
  1097. <xsl:attribute name="local-name" select="local-name()"/>
  1098. <xsl:attribute name="local-name-name" select="@name"/>
  1099. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1100. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1101. <xsl:attribute name="event_type" select="467"/>
  1102. <xsl:for-each select="@*">
  1103. <xsl:choose>
  1104. <xsl:when test="substring-before(name(),':')">
  1105. <xsl:attribute name="{name()}" select="."/>
  1106. </xsl:when>
  1107. <xsl:otherwise>
  1108. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1109. </xsl:otherwise>
  1110. </xsl:choose>
  1111. </xsl:for-each>
  1112. <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>
  1113. <xsl:apply-templates mode="#current">
  1114. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1115. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1116. <xsl:with-param name="root_name" select="$root_name"/>
  1117. <xsl:sort select="@system_cache__appinfo:sort"/>
  1118. </xsl:apply-templates>
  1119. </p5_tr_map:go_recurse_from_root_by_build_element_467>
  1120. </xsl:when>
  1121. <!-- simpleContent firstly instanced begin -->
  1122. <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 -->
  1123. <p5_tr_map:go_recurse_from_root_by_build_element_3941>
  1124. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1125. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1126. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1127. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1128. <xsl:attribute name="local-name" select="local-name()"/>
  1129. <xsl:attribute name="local-name-name" select="@name"/>
  1130. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1131. <xsl:attribute name="event_type" select="3941"/>
  1132. <xsl:attribute name="comment" select="'3941 simpleContent kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1133. <xsl:variable name="system_cache__appinfo:xpath_full">
  1134. <xsl:choose>
  1135. <xsl:when test="$system_cache__appinfo:xpath_full">
  1136. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1137. </xsl:when>
  1138. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1139. </xsl:choose>
  1140. </xsl:variable>
  1141. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1142. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1143. <xsl:for-each select="@*">
  1144. <xsl:choose>
  1145. <xsl:when test="substring-before(name(),':')">
  1146. <xsl:attribute name="{name()}" select="."/>
  1147. </xsl:when>
  1148. <xsl:otherwise>
  1149. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1150. </xsl:otherwise>
  1151. </xsl:choose>
  1152. </xsl:for-each>
  1153. <xsl:apply-templates mode="#current">
  1154. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1155. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1156. <xsl:with-param name="root_name" select="$root_name"/>
  1157. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1158. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1159. <xsl:sort select="@system_cache__appinfo:sort"/>
  1160. </xsl:apply-templates>
  1161. </p5_tr_map:go_recurse_from_root_by_build_element_3941>
  1162. </xsl:when>
  1163. <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 -->
  1164. <p5_tr_map:go_recurse_from_root_by_build_element_3940>
  1165. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1166. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1167. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1168. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1169. <xsl:attribute name="local-name" select="local-name()"/>
  1170. <xsl:attribute name="local-name-name" select="@name"/>
  1171. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1172. <xsl:attribute name="event_type" select="3940"/>
  1173. <xsl:attribute name="comment" select="'3940 simpleContent kolejna derewiacja w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1174. <xsl:variable name="system_cache__appinfo:xpath_full">
  1175. <xsl:choose>
  1176. <xsl:when test="$system_cache__appinfo:xpath_full">
  1177. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1178. </xsl:when>
  1179. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1180. </xsl:choose>
  1181. </xsl:variable>
  1182. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1183. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1184. <xsl:for-each select="@*">
  1185. <xsl:choose>
  1186. <xsl:when test="substring-before(name(),':')">
  1187. <xsl:attribute name="{name()}" select="."/>
  1188. </xsl:when>
  1189. <xsl:otherwise>
  1190. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1191. </xsl:otherwise>
  1192. </xsl:choose>
  1193. </xsl:for-each>
  1194. <xsl:apply-templates mode="#current">
  1195. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1196. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1197. <xsl:with-param name="root_name" select="$root_name"/>
  1198. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1199. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1200. <xsl:sort select="@system_cache__appinfo:sort"/>
  1201. </xsl:apply-templates>
  1202. </p5_tr_map:go_recurse_from_root_by_build_element_3940>
  1203. </xsl:when>
  1204. <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 -->
  1205. <p5_tr_map:go_recurse_from_root_by_build_element_3942>
  1206. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1207. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1208. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1209. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1210. <xsl:attribute name="local-name" select="local-name()"/>
  1211. <xsl:attribute name="local-name-name" select="@name"/>
  1212. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1213. <xsl:attribute name="event_type" select="3942"/>
  1214. <xsl:attribute name="comment" select="'3942 simpleContent pierwsza derewiacja i będą kolejne- w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1215. <xsl:variable name="system_cache__appinfo:xpath_full">
  1216. <xsl:choose>
  1217. <xsl:when test="$system_cache__appinfo:xpath_full">
  1218. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1219. </xsl:when>
  1220. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1221. </xsl:choose>
  1222. </xsl:variable>
  1223. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1224. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1225. <xsl:for-each select="@*">
  1226. <xsl:choose>
  1227. <xsl:when test="substring-before(name(),':')">
  1228. <xsl:attribute name="{name()}" select="."/>
  1229. </xsl:when>
  1230. <xsl:otherwise>
  1231. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1232. </xsl:otherwise>
  1233. </xsl:choose>
  1234. </xsl:for-each>
  1235. <xsl:apply-templates mode="#current">
  1236. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1237. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1238. <xsl:with-param name="root_name" select="$root_name"/>
  1239. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1240. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1241. <xsl:sort select="@system_cache__appinfo:sort"/>
  1242. </xsl:apply-templates>
  1243. </p5_tr_map:go_recurse_from_root_by_build_element_3942>
  1244. </xsl:when>
  1245. <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 -->
  1246. <p5_tr_map:go_recurse_from_root_by_build_element_394>
  1247. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1248. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1249. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1250. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1251. <xsl:attribute name="local-name" select="local-name()"/>
  1252. <xsl:attribute name="local-name-name" select="@name"/>
  1253. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1254. <xsl:attribute name="event_type" select="394"/>
  1255. <xsl:attribute name="comment" select="'394 jedyna simpleContent derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1256. <xsl:variable name="system_cache__appinfo:xpath_full">
  1257. <xsl:choose>
  1258. <xsl:when test="$system_cache__appinfo:xpath_full">
  1259. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1260. </xsl:when>
  1261. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1262. </xsl:choose>
  1263. </xsl:variable>
  1264. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1265. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1266. <xsl:for-each select="@*">
  1267. <xsl:choose>
  1268. <xsl:when test="substring-before(name(),':')">
  1269. <xsl:attribute name="{name()}" select="."/>
  1270. </xsl:when>
  1271. <xsl:otherwise>
  1272. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1273. </xsl:otherwise>
  1274. </xsl:choose>
  1275. </xsl:for-each>
  1276. <xsl:apply-templates mode="#current">
  1277. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1278. <xsl:with-param name="parent_name" select="$parent_name"/>
  1279. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1280. <xsl:with-param name="root_name" select="$root_name"/>
  1281. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1282. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1283. <xsl:sort select="@system_cache__appinfo:sort"/>
  1284. </xsl:apply-templates>
  1285. </p5_tr_map:go_recurse_from_root_by_build_element_394>
  1286. </xsl:when>
  1287. <!-- simpleContent firstly instanced end -->
  1288. <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 -->
  1289. <p5_tr_map:go_recurse_from_root_by_build_element_4941>
  1290. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1291. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1292. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1293. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1294. <xsl:attribute name="local-name" select="local-name()"/>
  1295. <xsl:attribute name="local-name-name" select="@name"/>
  1296. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1297. <xsl:attribute name="event_type" select="4941"/>
  1298. <xsl:attribute name="event_type_old" select="494"/>
  1299. <xsl:variable name="system_cache__appinfo:xpath_full">
  1300. <xsl:choose>
  1301. <xsl:when test="$system_cache__appinfo:xpath_full">
  1302. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1303. </xsl:when>
  1304. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1305. </xsl:choose>
  1306. </xsl:variable>
  1307. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1308. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1309. <xsl:for-each select="@*">
  1310. <xsl:choose>
  1311. <xsl:when test="substring-before(name(),':')">
  1312. <xsl:attribute name="{name()}" select="."/>
  1313. </xsl:when>
  1314. <xsl:otherwise>
  1315. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1316. </xsl:otherwise>
  1317. </xsl:choose>
  1318. </xsl:for-each>
  1319. <xsl:comment>4941 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID </xsl:comment>
  1320. <xsl:apply-templates mode="#current">
  1321. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1322. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1323. <xsl:with-param name="root_name" select="$root_name"/>
  1324. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1325. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1326. <xsl:sort select="@system_cache__appinfo:sort"/>
  1327. </xsl:apply-templates>
  1328. </p5_tr_map:go_recurse_from_root_by_build_element_4941>
  1329. </xsl:when>
  1330. <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 -->
  1331. <p5_tr_map:go_recurse_from_root_by_build_element_4940>
  1332. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1333. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1334. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1335. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1336. <xsl:attribute name="local-name" select="local-name()"/>
  1337. <xsl:attribute name="local-name-name" select="@name"/>
  1338. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1339. <xsl:attribute name="event_type" select="4940"/>
  1340. <xsl:attribute name="event_type_old" select="494"/>
  1341. <xsl:variable name="system_cache__appinfo:xpath_full">
  1342. <xsl:choose>
  1343. <xsl:when test="$system_cache__appinfo:xpath_full">
  1344. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1345. </xsl:when>
  1346. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1347. </xsl:choose>
  1348. </xsl:variable>
  1349. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1350. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1351. <xsl:for-each select="@*">
  1352. <xsl:choose>
  1353. <xsl:when test="substring-before(name(),':')">
  1354. <xsl:attribute name="{name()}" select="."/>
  1355. </xsl:when>
  1356. <xsl:otherwise>
  1357. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1358. </xsl:otherwise>
  1359. </xsl:choose>
  1360. </xsl:for-each>
  1361. <xsl:comment>4940 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID </xsl:comment>
  1362. <xsl:apply-templates mode="#current">
  1363. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1364. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1365. <xsl:with-param name="root_name" select="$root_name"/>
  1366. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1367. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1368. <xsl:sort select="@system_cache__appinfo:sort"/>
  1369. </xsl:apply-templates>
  1370. </p5_tr_map:go_recurse_from_root_by_build_element_4940>
  1371. </xsl:when>
  1372. <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 -->
  1373. <p5_tr_map:go_recurse_from_root_by_build_element_4942>
  1374. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1375. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1376. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1377. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1378. <xsl:attribute name="local-name" select="local-name()"/>
  1379. <xsl:attribute name="local-name-name" select="@name"/>
  1380. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1381. <xsl:attribute name="event_type" select="4942"/>
  1382. <xsl:attribute name="event_type_old" select="494"/>
  1383. <xsl:variable name="system_cache__appinfo:xpath_full">
  1384. <xsl:choose>
  1385. <xsl:when test="$system_cache__appinfo:xpath_full">
  1386. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1387. </xsl:when>
  1388. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1389. </xsl:choose>
  1390. </xsl:variable>
  1391. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1392. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1393. <xsl:for-each select="@*">
  1394. <xsl:choose>
  1395. <xsl:when test="substring-before(name(),':')">
  1396. <xsl:attribute name="{name()}" select="."/>
  1397. </xsl:when>
  1398. <xsl:otherwise>
  1399. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1400. </xsl:otherwise>
  1401. </xsl:choose>
  1402. </xsl:for-each>
  1403. <xsl:comment>4940 kolejna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID </xsl:comment>
  1404. <xsl:apply-templates mode="#current">
  1405. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1406. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1407. <xsl:with-param name="root_name" select="$root_name"/>
  1408. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1409. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1410. <xsl:sort select="@system_cache__appinfo:sort"/>
  1411. </xsl:apply-templates>
  1412. </p5_tr_map:go_recurse_from_root_by_build_element_4942>
  1413. </xsl:when>
  1414. <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 -->
  1415. <p5_tr_map:go_recurse_from_root_by_build_element_494>
  1416. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1417. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1418. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1419. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1420. <xsl:attribute name="local-name" select="local-name()"/>
  1421. <xsl:attribute name="local-name-name" select="@name"/>
  1422. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1423. <xsl:attribute name="event_type" select="494"/>
  1424. <xsl:attribute name="comment" select="'494 jedyna derewiacja np. database_objects:LinearRingType/LinearRingType/AbstractRingType - w kolejnej oczekujemy REMOTE_ID=parent::node()/ID '"/>
  1425. <xsl:variable name="system_cache__appinfo:xpath_full">
  1426. <xsl:choose>
  1427. <xsl:when test="$system_cache__appinfo:xpath_full">
  1428. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@system_cache__appinfo:prefix,':',@name)"/>
  1429. </xsl:when>
  1430. <xsl:otherwise><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@name)"/></xsl:otherwise>
  1431. </xsl:choose>
  1432. </xsl:variable>
  1433. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1434. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1435. <xsl:for-each select="@*">
  1436. <xsl:choose>
  1437. <xsl:when test="substring-before(name(),':')">
  1438. <xsl:attribute name="{name()}" select="."/>
  1439. </xsl:when>
  1440. <xsl:otherwise>
  1441. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1442. </xsl:otherwise>
  1443. </xsl:choose>
  1444. </xsl:for-each>
  1445. <xsl:apply-templates mode="#current">
  1446. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1447. <xsl:with-param name="parent_name" select="$parent_name"/>
  1448. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1449. <xsl:with-param name="root_name" select="$root_name"/>
  1450. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1451. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1452. <xsl:sort select="@system_cache__appinfo:sort"/>
  1453. </xsl:apply-templates>
  1454. </p5_tr_map:go_recurse_from_root_by_build_element_494>
  1455. </xsl:when>
  1456. <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 -->
  1457. <p5_tr_map:go_recurse_from_root_by_build_element_494d>
  1458. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1459. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1460. <xsl:attribute name="retrieve_REMOTE_ID" select="'empty(REMOTE_ID) or REMOTE_ID'"/>
  1461. <xsl:attribute name="retrieve_TYPE" select="$parent_type"/>
  1462. <xsl:attribute name="local-name" select="local-name()"/>
  1463. <xsl:attribute name="local-name-name" select="@name"/>
  1464. <xsl:attribute name="parent_name" select="$parent_name"/>
  1465. <xsl:attribute name="restriciction_base" select="@system_cache__appinfo:restriciction_base"/> <!-- zbedny argument tylko do pokazania, ze bylo to na restrykcji - moze sie przydac?-->
  1466. <xsl:attribute name="event_type" select="'494d'"/>
  1467. <xsl:attribute name="comment" select="'494d warunek complexType jako instancja elementu complexType bez @type - bez dziedziczen REMOTE_ID=parent::node()/ID '"/>
  1468. <xsl:variable name="system_cache__appinfo:xpath_full">
  1469. <xsl:value-of select="concat(@system_cache__appinfo:prefix,':',$parent_name)"/>
  1470. </xsl:variable>
  1471. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1472. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',$parent_name)"/>
  1473. <xsl:for-each select="@*">
  1474. <xsl:choose>
  1475. <xsl:when test="substring-before(name(),':')">
  1476. <xsl:attribute name="{name()}" select="."/>
  1477. </xsl:when>
  1478. <xsl:otherwise>
  1479. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1480. </xsl:otherwise>
  1481. </xsl:choose>
  1482. </xsl:for-each>
  1483. <xsl:apply-templates mode="#current">
  1484. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1485. <xsl:with-param name="parent_name" select="$parent_name"/>
  1486. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1487. <xsl:with-param name="root_name" select="$root_name"/>
  1488. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1489. <xsl:with-param name="system_cache__appinfo:xpath" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1490. <xsl:sort select="@system_cache__appinfo:sort"/>
  1491. </xsl:apply-templates>
  1492. </p5_tr_map:go_recurse_from_root_by_build_element_494d>
  1493. </xsl:when>
  1494. <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)-->
  1495. <p5_tr_map:go_recurse_from_root_by_build_element_4811>
  1496. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1497. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1498. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1499. <xsl:attribute name="local-name" select="local-name()"/>
  1500. <xsl:attribute name="local-name-name" select="@name"/>
  1501. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1502. <xsl:attribute name="event_type" select="4811"/>
  1503. <xsl:attribute name="parent_name" select="$parent_name"/>
  1504. <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-->
  1505. <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) '"/>
  1506. <xsl:for-each select="@*">
  1507. <xsl:choose>
  1508. <xsl:when test="substring-before(name(),':')">
  1509. <xsl:attribute name="{name()}" select="."/>
  1510. </xsl:when>
  1511. <xsl:otherwise>
  1512. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1513. </xsl:otherwise>
  1514. </xsl:choose>
  1515. </xsl:for-each>
  1516. <xsl:apply-templates mode="#current">
  1517. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1518. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1519. <xsl:with-param name="root_name" select="$root_name"/>
  1520. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/><!-- glownie na potrzeby przetwarzania complexType po 477b-->
  1521. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  1522. <xsl:sort select="@system_cache__appinfo:sort"/>
  1523. </xsl:apply-templates>
  1524. </p5_tr_map:go_recurse_from_root_by_build_element_4811>
  1525. </xsl:when>
  1526. <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 -->
  1527. <p5_tr_map:go_recurse_from_root_by_build_element_4810>
  1528. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1529. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1530. <xsl:attribute name="local-name" select="local-name()"/>
  1531. <xsl:attribute name="local-name-name" select="@name"/>
  1532. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1533. <xsl:attribute name="event_type" select="4810"/>
  1534. <xsl:attribute name="parent_name" select="$parent_name"/>
  1535. <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-->
  1536. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1537. <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) '"/>
  1538. <xsl:for-each select="@*">
  1539. <xsl:choose>
  1540. <xsl:when test="substring-before(name(),':')">
  1541. <xsl:attribute name="{name()}" select="."/>
  1542. </xsl:when>
  1543. <xsl:otherwise>
  1544. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1545. </xsl:otherwise>
  1546. </xsl:choose>
  1547. </xsl:for-each>
  1548. <xsl:apply-templates mode="#current">
  1549. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1550. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1551. <xsl:with-param name="root_name" select="$root_name"/>
  1552. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  1553. <xsl:sort select="@system_cache__appinfo:sort"/>
  1554. </xsl:apply-templates>
  1555. </p5_tr_map:go_recurse_from_root_by_build_element_4810>
  1556. </xsl:when>
  1557. <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... -->
  1558. <p5_tr_map:go_recurse_from_root_by_build_element_4812>
  1559. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1560. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1561. <xsl:attribute name="local-name" select="local-name()"/>
  1562. <xsl:attribute name="local-name-name" select="@name"/>
  1563. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1564. <xsl:attribute name="event_type" select="4812"/>
  1565. <xsl:attribute name="parent_name" select="$parent_name"/>
  1566. <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-->
  1567. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1568. <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) '"/>
  1569. <xsl:for-each select="@*">
  1570. <xsl:choose>
  1571. <xsl:when test="substring-before(name(),':')">
  1572. <xsl:attribute name="{name()}" select="."/>
  1573. </xsl:when>
  1574. <xsl:otherwise>
  1575. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1576. </xsl:otherwise>
  1577. </xsl:choose>
  1578. </xsl:for-each>
  1579. <xsl:apply-templates mode="#current">
  1580. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1581. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1582. <xsl:with-param name="root_name" select="$root_name"/>
  1583. <xsl:with-param name="p5_tr_map:parent_type" select="$p5_tr_map:parent_type"/>
  1584. <xsl:with-param name="p5_tr_map:parent_name" select="$p5_tr_map:parent_name"/>
  1585. <xsl:sort select="@system_cache__appinfo:sort"/>
  1586. </xsl:apply-templates>
  1587. </p5_tr_map:go_recurse_from_root_by_build_element_4812>
  1588. </xsl:when>
  1589. <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 -->
  1590. <p5_tr_map:go_recurse_from_root_by_build_element_481>
  1591. <xsl:attribute name="retrieve_ID" select="'parent::node()/REMOTE_ID'"/>
  1592. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- TODO przydalo by sie zapytac o typ? ale jak jest REMOTE_ID-->
  1593. <xsl:attribute name="local-name" select="local-name()"/>
  1594. <xsl:attribute name="local-name-name" select="@name"/>
  1595. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1596. <xsl:attribute name="event_type" select="481"/>
  1597. <xsl:attribute name="parent_name" select="$parent_name"/>
  1598. <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-->
  1599. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1600. <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) '"/>
  1601. <xsl:for-each select="@*">
  1602. <xsl:choose>
  1603. <xsl:when test="substring-before(name(),':')">
  1604. <xsl:attribute name="{name()}" select="."/>
  1605. </xsl:when>
  1606. <xsl:otherwise>
  1607. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1608. </xsl:otherwise>
  1609. </xsl:choose>
  1610. </xsl:for-each>
  1611. <xsl:apply-templates mode="#current">
  1612. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1613. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1614. <xsl:with-param name="root_name" select="$root_name"/>
  1615. <xsl:sort select="@system_cache__appinfo:sort"/>
  1616. </xsl:apply-templates>
  1617. </p5_tr_map:go_recurse_from_root_by_build_element_481>
  1618. </xsl:when>
  1619. <!--@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 -\->
  1620. <p5_tr_map:go_recurse_from_root_by_build_element_1069>
  1621. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1622. <!-\-<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>-\-><!-\- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-\->
  1623. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1624. <xsl:attribute name="local-name" select="local-name()"/>
  1625. <xsl:attribute name="local-name-name" select="@ref"/>
  1626. <xsl:attribute name="create_element" select="@ref"/>
  1627. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1628. <xsl:attribute name="event_type" select="'1069'"/>
  1629. <xsl:attribute name="event_name" select="'element[@ref]/element[@type]/complexType/simpleContent'"/>
  1630. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1631. <xsl:attribute name="comment" select="'1069 simpleContent element i type complexType with simpleContent like cT:gml:DirectPositionType '"/>
  1632. <xsl:for-each select="@*">
  1633. <xsl:choose>
  1634. <xsl:when test="substring-before(name(),':')">
  1635. <xsl:attribute name="{name()}" select="."/>
  1636. </xsl:when>
  1637. <xsl:otherwise>
  1638. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1639. </xsl:otherwise>
  1640. </xsl:choose>
  1641. </xsl:for-each>
  1642. <xsl:apply-templates mode="#current">
  1643. <!-\-<xsl:with-param name="parent_type" select="$parent_type"/>-\-> <!-\- nie ma tutaj complexType wiec nie ma instancji -\->
  1644. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1645. <xsl:with-param name="root_name" select="$root_name"/>
  1646. <xsl:sort select="@system_cache__appinfo:sort"/>
  1647. </xsl:apply-templates>
  1648. </p5_tr_map:go_recurse_from_root_by_build_element_1069>
  1649. </xsl:when>-->
  1650. <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 -->
  1651. <p5_tr_map:go_recurse_from_root_by_build_element_4777>
  1652. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1653. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  1654. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1655. <xsl:attribute name="local-name" select="local-name()"/>
  1656. <xsl:attribute name="local-name-name" select="@ref"/>
  1657. <xsl:attribute name="create_element" select="@ref"/>
  1658. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1659. <xsl:attribute name="event_type" select="4777"/>
  1660. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1661. <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 '"/>
  1662. <xsl:attribute name="position" select="count(preceding-sibling::*)"/>
  1663. <xsl:variable name="system_cache__appinfo:xpath_full">
  1664. <xsl:choose>
  1665. <xsl:when test="$system_cache__appinfo:xpath_full">
  1666. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@ref)"/>
  1667. </xsl:when>
  1668. <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
  1669. </xsl:choose>
  1670. </xsl:variable>
  1671. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1672. <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" -->
  1673. <xsl:for-each select="@*">
  1674. <xsl:choose>
  1675. <xsl:when test="substring-before(name(),':')">
  1676. <xsl:attribute name="{name()}" select="."/>
  1677. </xsl:when>
  1678. <xsl:otherwise>
  1679. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1680. </xsl:otherwise>
  1681. </xsl:choose>
  1682. </xsl:for-each>
  1683. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1684. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1685. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1686. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1687. </xsl:if>
  1688. <!--<xsl:apply-templates mode="#current">
  1689. <!-\-<xsl:with-param name="parent_type" select="$parent_type"/>-\-> <!-\- nie ma tutaj complexType wiec nie ma instancji -\->
  1690. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1691. <xsl:with-param name="root_name" select="$root_name"/>
  1692. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1693. <xsl:with-param name="p5_tr_map:last-type" select="'4777'"/>
  1694. <xsl:with-param name="p5_tr_map:parent_name" select="@ref"/>
  1695. <xsl:sort select="@system_cache__appinfo:sort"/>
  1696. </xsl:apply-templates>-->
  1697. <system_cache__appinfo:schema><xsl:copy-of select="."/></system_cache__appinfo:schema>
  1698. </p5_tr_map:go_recurse_from_root_by_build_element_4777>
  1699. </xsl:when>
  1700. <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 -->
  1701. <p5_tr_map:go_recurse_from_root_by_build_element_477>
  1702. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1703. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  1704. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1705. <xsl:attribute name="local-name" select="local-name()"/>
  1706. <xsl:attribute name="local-name-name" select="@ref"/>
  1707. <xsl:attribute name="create_element" select="@ref"/>
  1708. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1709. <xsl:attribute name="event_type" select="477"/>
  1710. <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" -->
  1711. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1712. <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 '"/>
  1713. <xsl:variable name="system_cache__appinfo:xpath_full">
  1714. <xsl:choose>
  1715. <xsl:when test="$system_cache__appinfo:xpath_full">
  1716. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@ref)"/>
  1717. </xsl:when>
  1718. <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
  1719. </xsl:choose>
  1720. </xsl:variable>
  1721. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1722. <xsl:for-each select="@*">
  1723. <xsl:choose>
  1724. <xsl:when test="substring-before(name(),':')">
  1725. <xsl:attribute name="{name()}" select="."/>
  1726. </xsl:when>
  1727. <xsl:otherwise>
  1728. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1729. </xsl:otherwise>
  1730. </xsl:choose>
  1731. </xsl:for-each>
  1732. <xsl:variable name="p5_tr_map:detect_loop_from_build_complexType_node">
  1733. <xsl:apply-templates mode="p5_tr_map:detect_loop_from_build_complexType_node"/>
  1734. </xsl:variable>
  1735. <xsl:choose>
  1736. <xsl:when test="$p5_tr_map:detect_loop_from_build_complexType_node/p5_tr_map:detect_loop_from_build_complexType_node">
  1737. <xsl:attribute name="system_cache__appinfo:loop_name" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_name"/>
  1738. <xsl:attribute name="system_cache__appinfo:loop_id" select="$p5_tr_map:detect_loop_from_build_complexType_node//@system_cache__appinfo:loop_id"/>
  1739. <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"/>
  1740. <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'"/>
  1741. </xsl:when>
  1742. <xsl:otherwise>
  1743. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1744. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1745. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1746. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1747. </xsl:if>
  1748. </xsl:otherwise>
  1749. </xsl:choose>
  1750. <xsl:apply-templates mode="#current">
  1751. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1752. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1753. <xsl:with-param name="root_name" select="$root_name"/>
  1754. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1755. <xsl:with-param name="p5_tr_map:last-type" select="'477'"/>
  1756. <xsl:with-param name="p5_tr_map:parent_name" select="@ref"/>
  1757. <xsl:sort select="@system_cache__appinfo:sort"/>
  1758. </xsl:apply-templates>
  1759. </p5_tr_map:go_recurse_from_root_by_build_element_477>
  1760. </xsl:when>
  1761. <xsl:when test="( local-name()='attribute' ) and @ref"><!-- warunek 4771 pobranie atrybutu z referencja - ma @ref i musi miec REMOTE_ID -->
  1762. <p5_tr_map:go_recurse_from_root_by_build_element_4771>
  1763. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1764. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--><!-- Nie potrzebny jest tutaj typ, bo to nie jest instancyjna-->
  1765. <xsl:attribute name="retrieve_REMOTE_ID" select="'not empty(REMOTE_ID)'"/>
  1766. <xsl:attribute name="local-name" select="local-name()"/>
  1767. <xsl:attribute name="local-name-name" select="@ref"/>
  1768. <xsl:attribute name="create_element" select="@ref"/>
  1769. <xsl:attribute name="requested-table-type" select="'INSTANCE'"/>
  1770. <xsl:attribute name="event_type" select="4771"/>
  1771. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1772. <xsl:attribute name="comment" select="'4771 (aktualizacja @prefix_for_elements) pobranie atrybutu z referencja. ma @ref i musi miec REMOTE_ID '"/>
  1773. <xsl:variable name="system_cache__appinfo:xpath_full">
  1774. <xsl:choose>
  1775. <xsl:when test="$system_cache__appinfo:xpath_full">
  1776. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@ref)"/>
  1777. </xsl:when>
  1778. <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
  1779. </xsl:choose>
  1780. </xsl:variable>
  1781. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1782. <xsl:apply-templates mode="relation_info_from_appinfo_not_flat"/>
  1783. <xsl:for-each select="@*">
  1784. <xsl:choose>
  1785. <xsl:when test="substring-before(name(),':')">
  1786. <xsl:attribute name="{name()}" select="."/>
  1787. </xsl:when>
  1788. <xsl:otherwise>
  1789. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1790. </xsl:otherwise>
  1791. </xsl:choose>
  1792. </xsl:for-each>
  1793. <xsl:if test="child::node()/system_cache__appinfo:loop">
  1794. <xsl:attribute name="system_cache__appinfo:loop_name" select="child::node()/system_cache__appinfo:loop/@name"/>
  1795. <xsl:attribute name="system_cache__appinfo:loop_id" select="child::node()/system_cache__appinfo:loop/@id"/>
  1796. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="child::node()/system_cache__appinfo:loop/@name_with_prefix"/>
  1797. </xsl:if>
  1798. <xsl:apply-templates mode="#current">
  1799. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1800. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1801. <xsl:with-param name="root_name" select="$root_name"/>
  1802. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1803. <xsl:with-param name="p5_tr_map:last-type" select="'4771'"/>
  1804. <xsl:with-param name="p5_tr_map:parent_name" select="@ref"/>
  1805. <xsl:sort select="@system_cache__appinfo:sort"/>
  1806. </xsl:apply-templates>
  1807. </p5_tr_map:go_recurse_from_root_by_build_element_4771>
  1808. </xsl:when>
  1809. <xsl:when test="local-name()='attribute' and @ref"><!-- warunek 549 - atrybuty z ref do innego atrybutu - opuscic do dziecka id-->
  1810. <xsl:comment>
  1811. 549 attrybuty z referencja do innego atrybutu opuscic do dziecka id: <xsl:value-of select="@id"/> </xsl:comment>
  1812. <xsl:apply-templates mode="#current">
  1813. <xsl:with-param name="parent_type" select="$parent_type"/> <!-- todo brakuje prefixu-->
  1814. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1815. <xsl:sort select="@system_cache__appinfo:sort"/>
  1816. </xsl:apply-templates>
  1817. </xsl:when>
  1818. <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'-->
  1819. <p5_tr_map:go_recurse_from_root_by_build_element_459>
  1820. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1821. <xsl:attribute name="local-name" select="local-name()"/>
  1822. <xsl:attribute name="local-name-name" select="@name"/>
  1823. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1824. <xsl:attribute name="event_type" select="459"/>
  1825. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1826. <xsl:attribute name="comment" select="'459 element lub atrybut typu simpleType - podobny do 381. '"/>
  1827. <xsl:for-each select="@*">
  1828. <xsl:choose>
  1829. <xsl:when test="substring-before(name(),':')">
  1830. <xsl:attribute name="{name()}" select="."/>
  1831. </xsl:when>
  1832. <xsl:otherwise>
  1833. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1834. </xsl:otherwise>
  1835. </xsl:choose>
  1836. </xsl:for-each>
  1837. <xsl:apply-templates mode="#current">
  1838. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- nie ma tutaj complexType wiec nie ma instancji -->
  1839. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1840. <xsl:with-param name="root_name" select="$root_name"/>
  1841. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1842. <xsl:with-param name="p5_tr_map:last-type" select="'459'"/>
  1843. <!--<xsl:with-param name="p5_tr_map:parent_type" select="@type"/>-->
  1844. <!--<xsl:with-param name="parent_type" select="@type"/>-->
  1845. <xsl:sort select="@system_cache__appinfo:sort"/>
  1846. </xsl:apply-templates>
  1847. <xsl:comment>459 to musi byc xs:simpletype - dodatkowy wyjatek w przypadku powiazanego obcego typu simpleType </xsl:comment>
  1848. </p5_tr_map:go_recurse_from_root_by_build_element_459>
  1849. </xsl:when>
  1850. <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' -->
  1851. <p5_tr_map:go_recurse_from_root_by_build_element_459b>
  1852. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1853. <xsl:attribute name="local-name" select="local-name()"/>
  1854. <xsl:attribute name="local-name-name" select="@name"/>
  1855. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1856. <xsl:attribute name="event_type" select="'459b'"/>
  1857. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1858. <xsl:attribute name="comment" select="'459b element /schema/complexType/@ref/!_element_! typu simpleType za @ref, bez simpleContent, bez przetwarzania wglab. Przetwarzanie jak w 394'"/>
  1859. <xsl:for-each select="@*">
  1860. <xsl:choose>
  1861. <xsl:when test="substring-before(name(),':')">
  1862. <xsl:attribute name="{name()}" select="."/>
  1863. </xsl:when>
  1864. <xsl:otherwise>
  1865. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1866. </xsl:otherwise>
  1867. </xsl:choose>
  1868. </xsl:for-each>
  1869. </p5_tr_map:go_recurse_from_root_by_build_element_459b>
  1870. </xsl:when>
  1871. <!--<xsl:when test="( local-name()='element' or local-name()='attribute' ) and child::node()/local-name()='simpleContent'"><!-\- warunek 1128 -\->
  1872. <p5_tr_map:go_recurse_from_root_by_build_element_1128>
  1873. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1874. <xsl:attribute name="local-name" select="local-name()"/>
  1875. <xsl:attribute name="local-name-name" select="@name"/>
  1876. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  1877. <xsl:attribute name="event_type" select="1128"/>
  1878. <xsl:for-each select="@*">
  1879. <xsl:choose>
  1880. <xsl:when test="substring-before(name(),':')">
  1881. <xsl:attribute name="{name()}" select="."/>
  1882. </xsl:when>
  1883. <xsl:otherwise>
  1884. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1885. </xsl:otherwise>
  1886. </xsl:choose>
  1887. </xsl:for-each>
  1888. <xsl:comment>1128 to musi byc xs:simpletype z simpleContent dodatkowy wyjatek w przypadku powiazanego obcego typu simpleType dla atrybutu </xsl:comment>
  1889. <xsl:apply-templates mode="#current">
  1890. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1891. <xsl:with-param name="root_name" select="$root_name"/>
  1892. <xsl:sort select="@system_cache__appinfo:sort"/>
  1893. </xsl:apply-templates>
  1894. </p5_tr_map:go_recurse_from_root_by_build_element_1128>
  1895. </xsl:when>-->
  1896. <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 -->
  1897. <p5_tr_map:go_recurse_from_root_by_build_element_394-720>
  1898. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1899. <xsl:attribute name="local-name" select="local-name()"/>
  1900. <xsl:attribute name="local-name-name" select="@name"/>
  1901. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1902. <xsl:attribute name="comment" select="'394-720 pobranie wartosci atrybutu po @ref z tabeli instancja+value '"/>
  1903. <xsl:attribute name="create_element" select="@name"/>
  1904. <xsl:attribute name="event_type" select="'394-720'"/>
  1905. <xsl:variable name="system_cache__appinfo:xpath_full">
  1906. <xsl:choose>
  1907. <xsl:when test="$system_cache__appinfo:xpath_full">
  1908. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  1909. </xsl:when>
  1910. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  1911. </xsl:choose>
  1912. </xsl:variable>
  1913. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1914. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  1915. <xsl:for-each select="@*">
  1916. <xsl:choose>
  1917. <xsl:when test="substring-before(name(),':')">
  1918. <xsl:attribute name="{name()}" select="."/>
  1919. </xsl:when>
  1920. <xsl:otherwise>
  1921. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1922. </xsl:otherwise>
  1923. </xsl:choose>
  1924. </xsl:for-each>
  1925. </p5_tr_map:go_recurse_from_root_by_build_element_394-720>
  1926. </xsl:when>
  1927. <xsl:when test="local-name()='attribute' and ( empty(child::node()/element()) or child::node()/local-name()='simpleType' )"><!-- warunek 720 atrybut -->
  1928. <p5_tr_map:go_recurse_from_root_by_build_element_720>
  1929. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  1930. <xsl:attribute name="local-name" select="local-name()"/>
  1931. <xsl:attribute name="local-name-name" select="@name"/>
  1932. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1933. <xsl:attribute name="comment" select="'720 pobranie wartosci atrybutu.'"/>
  1934. <xsl:attribute name="create_element" select="@name"/> <!-- @2015-06-05 bindera: nie znalazlem schematu z attrybutem aby name mialo prefix-->
  1935. <xsl:attribute name="event_type" select="720"/>
  1936. <xsl:variable name="system_cache__appinfo:xpath_full">
  1937. <xsl:choose>
  1938. <xsl:when test="$system_cache__appinfo:xpath_full">
  1939. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  1940. </xsl:when>
  1941. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  1942. </xsl:choose>
  1943. </xsl:variable>
  1944. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1945. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  1946. <xsl:for-each select="@*">
  1947. <xsl:choose>
  1948. <xsl:when test="substring-before(name(),':')">
  1949. <xsl:attribute name="{name()}" select="."/>
  1950. </xsl:when>
  1951. <xsl:otherwise>
  1952. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1953. </xsl:otherwise>
  1954. </xsl:choose>
  1955. </xsl:for-each>
  1956. </p5_tr_map:go_recurse_from_root_by_build_element_720>
  1957. </xsl:when>
  1958. <xsl:when test="local-name()='sequence' or local-name()='all' or local-name()='choice'"><!-- warunek 473 sekwencje -->
  1959. <p5_tr_map:go_recurse_from_root_by_build_element_473>
  1960. <xsl:attribute name="retrieve_PARENT_ID" select="'parent::node()/ID'"/>
  1961. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>-->
  1962. <xsl:attribute name="retrieve_resource_id" select="@id"/>
  1963. <xsl:attribute name="local-name" select="local-name()"/>
  1964. <xsl:attribute name="event_type" select="473"/>
  1965. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  1966. <xsl:attribute name="comment" select="'warunek 473 sekwencje'"/>
  1967. <xsl:for-each select="@*">
  1968. <xsl:choose>
  1969. <xsl:when test="substring-before(name(),':')">
  1970. <xsl:attribute name="{name()}" select="."/>
  1971. </xsl:when>
  1972. <xsl:otherwise>
  1973. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  1974. </xsl:otherwise>
  1975. </xsl:choose>
  1976. </xsl:for-each>
  1977. <xsl:comment>473 sekwencje </xsl:comment>
  1978. <xsl:apply-templates mode="#current">
  1979. <!--<xsl:with-param name="parent_type" select="$parent_type"/>--> <!-- todo brakuje prefixu-->
  1980. <xsl:with-param name="ID" select="concat($parent_type,'(',$ID,')')"/>
  1981. <xsl:with-param name="root_name" select="$root_name"/>
  1982. <xsl:with-param name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  1983. <xsl:with-param name="system_cache__appinfo:xpath" select="$system_cache__appinfo:xpath"/>
  1984. <xsl:with-param name="p5_tr_map:last-type" select="'473'"/>
  1985. <xsl:sort select="@system_cache__appinfo:sort"/>
  1986. </xsl:apply-templates>
  1987. </p5_tr_map:go_recurse_from_root_by_build_element_473>
  1988. </xsl:when>
  1989. <xsl:when test="local-name()='unique'"><!-- warunek 591 klucze tymczasowo nieobslugiwane lecz nie sa bledem -->
  1990. <!--<system_cache__appinfo:go_recurse_from_root_by_build_element>
  1991. <xsl:attribute name="local-name" select="local-name()"/>
  1992. <xsl:attribute name="event_type" select="591"/>
  1993. <xsl:for-each select="@*">
  1994. <xsl:choose>
  1995. <xsl:when test="substring-before(name(),':')">
  1996. <xsl:attribute name="{name()}" select="."/>
  1997. </xsl:when>
  1998. <xsl:otherwise>
  1999. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  2000. </xsl:otherwise>
  2001. </xsl:choose>
  2002. </xsl:for-each>-->
  2003. <!--<xsl:comment>591 klucze tymczasowo nieobslugiwane lecz nie sa bledem </xsl:comment>-->
  2004. <!--</system_cache__appinfo:go_recurse_from_root_by_build_element>-->
  2005. </xsl:when>
  2006. <xsl:when test="local-name()='element' and not(child::node()[local-name()!='appinfo']/* ) "><!-- warunek 428a element pusty bez zdefiniowanego typu , bez dziecka-->
  2007. <p5_tr_map:go_recurse_from_root_by_build_element_428a>
  2008. <xsl:attribute name="retrieve_ID" select="'parent::node()/ID'"/>
  2009. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--> <!-- nie ma potrzeby wskazywania na typ, bo powiazany obiekt nie jest instancyjny-->
  2010. <xsl:attribute name="local-name" select="local-name()"/>
  2011. <xsl:attribute name="local-name-name" select="@name"/>
  2012. <xsl:variable name="system_cache__appinfo:xpath_full">
  2013. <xsl:choose>
  2014. <xsl:when test="$system_cache__appinfo:xpath_full">
  2015. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  2016. </xsl:when>
  2017. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  2018. </xsl:choose>
  2019. </xsl:variable>
  2020. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  2021. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  2022. <xsl:choose>
  2023. <xsl:when test="substring-before($root_name,':')=@system_cache__appinfo:prefix"> <!-- dla lokalnego elementu prefixu nie dajemy prefixu -->
  2024. <xsl:attribute name="create_element" select="@name"/>
  2025. </xsl:when>
  2026. <xsl:otherwise>
  2027. <xsl:attribute name="create_element" select="concat(@system_cache__appinfo:prefix,':',@name)"/>
  2028. </xsl:otherwise>
  2029. </xsl:choose>
  2030. <xsl:attribute name="event_type" select="'428a'"/>
  2031. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  2032. <xsl:attribute name="comment" select="concat('428a - parent_name:',$root_name,' pusty element - tylko instancja')"/>
  2033. <xsl:for-each select="@*">
  2034. <xsl:choose>
  2035. <xsl:when test="substring-before(name(),':')">
  2036. <!--<xsl:attribute name="{name()}" select="."/>-->
  2037. <xsl:copy-of select="."/>
  2038. </xsl:when>
  2039. <xsl:otherwise>
  2040. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  2041. </xsl:otherwise>
  2042. </xsl:choose>
  2043. </xsl:for-each>
  2044. <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>
  2045. </p5_tr_map:go_recurse_from_root_by_build_element_428a>
  2046. </xsl:when>
  2047. <!--<xsl:when test="comment()"><xsl:comment><xsl:value-of select="self::comment()"/></xsl:comment></xsl:when>-->
  2048. <xsl:when test="name()='system_cache__appinfo:loop'">
  2049. <p5_tr_map:go_recurse_from_root_by_build_element_loop>
  2050. <!--<xsl:attribute name="retrieve_TYPE" select="$parent_type"/>--> <!-- nie ma potrzeby wskazywania na typ, bo powiazany obiekt nie jest instancyjny-->
  2051. <xsl:attribute name="local-name" select="local-name()"/>
  2052. <xsl:variable name="system_cache__appinfo:xpath_full">
  2053. <xsl:choose>
  2054. <xsl:when test="$system_cache__appinfo:xpath_full">
  2055. <xsl:value-of select="concat($system_cache__appinfo:xpath_full,'/',@name)"/>
  2056. </xsl:when>
  2057. <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
  2058. </xsl:choose>
  2059. </xsl:variable>
  2060. <xsl:attribute name="system_cache__appinfo:xpath_full" select="$system_cache__appinfo:xpath_full"/>
  2061. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($system_cache__appinfo:xpath,'/',@name)"/>
  2062. <xsl:attribute name="event_type" select="'loop'"/>
  2063. <xsl:attribute name="p5_tr_map:uuid" select="$p5_tr_map:uuid"/>
  2064. <xsl:attribute name="comment" select="concat('loop - petla ',$root_name,' ')"/>
  2065. <xsl:attribute name="root_name" select="$root_name"/>
  2066. <xsl:for-each select="@*">
  2067. <xsl:choose>
  2068. <xsl:when test="substring-before(name(),':')">
  2069. <xsl:attribute name="{name()}" select="."/>
  2070. </xsl:when>
  2071. <xsl:otherwise>
  2072. <xsl:attribute name="{concat('system_cache__appinfo:',name())}" select="."/>
  2073. </xsl:otherwise>
  2074. </xsl:choose>
  2075. </xsl:for-each>
  2076. <xsl:comment>loop - zapetlenie schematu wymaga osobnej instancji do obiektu zagniezdzonego </xsl:comment>
  2077. </p5_tr_map:go_recurse_from_root_by_build_element_loop>
  2078. </xsl:when>
  2079. <xsl:when test="local-name()='appinfo' or local-name()='annotation'">
  2080. <xsl:comment>#1252 appinfo supperssed there... for future transforming</xsl:comment>
  2081. </xsl:when>
  2082. <xsl:otherwise>
  2083. <xsl:if test="node()">
  2084. <p5_tr_map:go_recurse_from_root_by_build_element_592>
  2085. <xsl:attribute name="BLAD_OTHERWISE"/>
  2086. <xsl:attribute name="parent_type" select="$parent_type"/>
  2087. <xsl:attribute name="id" select="@id"/>
  2088. <xsl:attribute name="ID" select="$ID"/>
  2089. <xsl:attribute name="INSTANCE_ID" select="$INSTANCE_ID"/>
  2090. <xsl:attribute name="prefix" select="$prefix"/>
  2091. <xsl:attribute name="element_name" select="$element_name"/>
  2092. <xsl:attribute name="system_cache__appinfo:prefix" select="@system_cache__appinfo:prefix"/>
  2093. <xsl:attribute name="system_cache__appinfo:namespace_uri" select="@system_cache__appinfo:namespace_uri"/>
  2094. <xsl:attribute name="event_type" select="592"/>
  2095. <xsl:attribute name="child_node_name" select="child::node()/name()"/>
  2096. <xsl:attribute name="parent_node_name" select="parent::node()/name()"/>
  2097. <xsl:attribute name="p5_tr_map:last-type" select='$p5_tr_map:last-type'/>
  2098. <xsl:attribute name="local-name" select="local-name()"/>
  2099. <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>
  2100. <schema>
  2101. <xsl:copy-of select="."/>
  2102. </schema>
  2103. </p5_tr_map:go_recurse_from_root_by_build_element_592>
  2104. </xsl:if>
  2105. </xsl:otherwise>
  2106. </xsl:choose>
  2107. </xsl:template>
  2108. <xsl:template match="key" mode="p5_tr_map:go_recurse_from_root_by_build_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2109. <xsl:comment>#2069 mode="p5_tr_map:go_recurse_from_root_by_build_element" match="key" - TODO to implement key features</xsl:comment>
  2110. </xsl:template>
  2111. <xsl:template match="assert" mode="p5_tr_map:go_recurse_from_root_by_build_element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2112. <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>
  2113. </xsl:template>
  2114. <xsl:template match="comment()|text()" mode="p5_tr_map:go_recurse_from_root_by_build_element"/>
  2115. <xsl:template match="comment()|text()" mode="p5_tr_map:go_recurse_from_root_by_build_complexType"/>
  2116. <!-- @2016-02-03 template do wykrycia glownie z wezla 477 czy pod nim nie jest loop z kawalkiem instancji -->
  2117. <xsl:template match="element" mode="p5_tr_map:detect_loop_from_build_complexType_node" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2118. <xsl:choose>
  2119. <xsl:when test="@ref"/>
  2120. <xsl:otherwise>
  2121. <xsl:comment>#2058 pass element @id:<xsl:value-of select="@id"/></xsl:comment>
  2122. <xsl:apply-templates mode="#current"/>
  2123. </xsl:otherwise>
  2124. </xsl:choose>
  2125. </xsl:template>
  2126. <xsl:template match="complexType" mode="p5_tr_map:detect_loop_from_build_complexType_node" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2127. <xsl:comment>#2063 pass complexType @id:<xsl:value-of select="@id"/></xsl:comment>
  2128. <xsl:apply-templates mode="#current"/>
  2129. </xsl:template>
  2130. <xsl:template match="system_cache__appinfo:loop" mode="p5_tr_map:detect_loop_from_build_complexType_node">
  2131. <xsl:element name="p5_tr_map:detect_loop_from_build_complexType_node">
  2132. <xsl:attribute name="system_cache__appinfo:loop_name" select="@name"/>
  2133. <xsl:attribute name="system_cache__appinfo:loop_id" select="@id"/>
  2134. <xsl:attribute name="system_cache__appinfo:loop_name_with_prefix" select="@name_with_prefix"/>
  2135. <xsl:attribute name="comment" select="'child nodes analyzed - there is loop'"/>
  2136. </xsl:element>
  2137. </xsl:template>
  2138. <!--<xsl:template match="text()|comment()" mode="p5_tr_map:detect_loop_from_build_complexType_node"/>-->
  2139. <!-- @2017-03-06 bindera: dla potrzeb silnika ant i usprawnienia odbudowania refow w plaskiej bazie -->
  2140. <xsl:template mode="relation_info_from_appinfo_not_flat" match="annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2141. <xsl:apply-templates mode="relation_info_from_appinfo_not_flat"/>
  2142. </xsl:template>
  2143. <xsl:template mode="relation_info_from_appinfo_not_flat" match="appinfo" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  2144. <xsl:for-each select="system_cache__appinfo:flat_relation_cache/system_cache__appinfo:source">
  2145. <xsl:attribute name="flat_relation_cache_name" select="@system_cache__appinfo:name"/>
  2146. <xsl:attribute name="flat_relation_cache_xpath" select="@system_cache__appinfo:xpath"/>
  2147. </xsl:for-each>
  2148. </xsl:template>
  2149. <xsl:template mode="relation_info_from_appinfo_not_flat" match="*|text()|comment()"/>
  2150. <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 -->
  2151. <xsl:param name="native_procesy5_table_prefix" select="'default_db'"/>
  2152. <xsl:param name="p5_tr_map:go_recurse_from_root_by_build_element" required="yes"/>
  2153. <xsl:variable name="detect_first_ref_to_native_procesy5_table_multi">
  2154. <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">
  2155. <xsl:with-param name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>
  2156. </xsl:apply-templates>
  2157. </xsl:variable>
  2158. <!--<temp_to_parse>
  2159. <xsl:copy-of select="$detect_first_ref_to_native_procesy5_table_multi"></xsl:copy-of>
  2160. </temp_to_parse>-->
  2161. <xsl:for-each select="$detect_first_ref_to_native_procesy5_table_multi/*[1]">
  2162. <xsl:element name="{name()}">
  2163. <xsl:for-each select="@*">
  2164. <xsl:attribute name="{name()}" select="."/>
  2165. </xsl:for-each>
  2166. </xsl:element>
  2167. </xsl:for-each>
  2168. <!--<xsl:copy-of select="$detect_first_ref_to_native_procesy5_table_multi/*[position()=1]"/>-->
  2169. </xsl:template>
  2170. <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">
  2171. <xsl:param name="native_procesy5_table_prefix" select="'default_db'"/>
  2172. <xsl:param name="trigger_event477_used"/> <!-- trigger do template aby tylko jeden raz byl przetwarzany ref typu 477 i wiecej -->
  2173. <xsl:choose>
  2174. <xsl:when test="@event_type='481'">
  2175. <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>
  2176. </xsl:when>
  2177. <xsl:when test=" (@event_type='477' or @event_type='477b' )and not(substring-before(@system_cache__appinfo:ref,':')=$native_procesy5_table_prefix)">
  2178. <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>
  2179. </xsl:when>
  2180. <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 -->
  2181. <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>
  2182. <xsl:element name="system_cache__appinfo:detect_first_ref_to_native_procesy5_table">
  2183. <xsl:attribute name="event_type" select="@event_type"/>
  2184. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:ref"/>
  2185. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2186. <xsl:attribute name="p5_tr_map:uuid" select="@p5_tr_map:uuid"/>
  2187. <!--<xsl:attribute name="substring-before" select="substring-before(@system_cache__appinfo:ref,':')"/>
  2188. <xsl:attribute name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>-->
  2189. </xsl:element>
  2190. </xsl:when>
  2191. <xsl:when test="not($trigger_event477_used) and ( @event_type='477' or @event_type='477b' ) ">
  2192. <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>
  2193. <xsl:apply-templates mode="#current">
  2194. <xsl:with-param name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>
  2195. <xsl:with-param name="trigger_event477_used" select="1"/>
  2196. </xsl:apply-templates>
  2197. </xsl:when>
  2198. <xsl:when test="not($trigger_event477_used)">
  2199. <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>
  2200. <xsl:apply-templates mode="#current">
  2201. <xsl:with-param name="native_procesy5_table_prefix" select="$native_procesy5_table_prefix"/>
  2202. </xsl:apply-templates>
  2203. </xsl:when>
  2204. <xsl:otherwise/>
  2205. </xsl:choose>
  2206. </xsl:template>
  2207. <!-- @2015-09-25 template do znalezienia z jakimi tabelami plaskimi procesy5 dany element ma relacje
  2208. na wejsciu system_cache__appinfo:go_recurse_from_root_by_build_element-->
  2209. <xsl:template name="p5_tr_map:detect_element_relations_to_objects">
  2210. <xsl:param name="system_cache__appinfo:detect_root_sequence_id" required="no"/>
  2211. <xsl:param name="p5_tr_map:go_recurse_from_root_by_build_element" required="no"/>
  2212. <xsl:apply-templates mode="p5_tr_map:detect_element_relations_to_objects" select="$p5_tr_map:go_recurse_from_root_by_build_element"/>
  2213. <!-- //node()[@system_cache__appinfo:id=$system_cache__appinfo:detect_root_sequence_id//@id]/*-->
  2214. <!--<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]"/>-->
  2215. </xsl:template>
  2216. <!-- to be used by template name="system_cache__appinfo:go_recurse_from_root_by_build_element"-->
  2217. <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">
  2218. <xsl:param name="p5_tr_map:relation_after_derivation"/>
  2219. <xsl:param name="p5_tr_map:ancestor-count" select="1"/>
  2220. <xsl:choose>
  2221. <xsl:when test="@event_type='434' or @event_type='434d' ">
  2222. <xsl:apply-templates mode="#current">
  2223. <xsl:with-param name="p5_tr_map:relation_after_derivation" select="$p5_tr_map:relation_after_derivation"/>
  2224. </xsl:apply-templates>
  2225. </xsl:when>
  2226. <xsl:when test="@event_type='4940' or @event_type='4941' ">
  2227. <xsl:apply-templates mode="#current">
  2228. <xsl:with-param name="p5_tr_map:relation_after_derivation" select="true()"/>
  2229. <xsl:with-param name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count + 1"/>
  2230. </xsl:apply-templates>
  2231. </xsl:when>
  2232. <xsl:when test="@event_type='494' or @event_type='4942' or @event_type='494d' ">
  2233. <xsl:apply-templates mode="#current">
  2234. <xsl:with-param name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count + 1"/>
  2235. </xsl:apply-templates>
  2236. </xsl:when>
  2237. <xsl:when test="@event_type='473'">
  2238. <xsl:apply-templates mode="#current">
  2239. <xsl:with-param name="p5_tr_map:relation_after_derivation" select="$p5_tr_map:relation_after_derivation"/>
  2240. <xsl:with-param name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count + 1"/>
  2241. </xsl:apply-templates>
  2242. </xsl:when>
  2243. <xsl:when test="@event_type='477'">
  2244. <xsl:element name="system_cache__appinfo:detect_element_relations_to_objects">
  2245. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:ref"/>
  2246. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2247. <xsl:attribute name="system_cache__appinfo:event_type" select="@event_type"/>
  2248. <xsl:attribute name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count"/>
  2249. <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>
  2250. </xsl:element>
  2251. </xsl:when>
  2252. <!--<xsl:when test="@event_type='4771'">@2016-01-20 todo attributes na ref
  2253. <xsl:element name="system_cache__appinfo:detect_element_relations_to_objects">
  2254. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:ref"/>
  2255. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2256. </xsl:element>
  2257. </xsl:when>-->
  2258. <xsl:when test="@event_type='477b'">
  2259. <xsl:element name="system_cache__appinfo:detect_element_relations_to_objects">
  2260. <xsl:attribute name="system_cache__appinfo:ref" select="@system_cache__appinfo:type"/>
  2261. <xsl:attribute name="system_cache__appinfo:id" select="@system_cache__appinfo:id"/>
  2262. <xsl:attribute name="system_cache__appinfo:event_type" select="@event_type"/>
  2263. <xsl:attribute name="p5_tr_map:ancestor-count" select="$p5_tr_map:ancestor-count"/>
  2264. <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>
  2265. </xsl:element>
  2266. </xsl:when>
  2267. <!--<xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2268. <xsl:apply-templates mode="#current"/>
  2269. </xsl:when>-->
  2270. </xsl:choose>
  2271. </xsl:template>
  2272. <!--<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"/>-->
  2273. <!-- testowo template do wykorzystywania przy generowaniu konfigow relacji do wykrycia jaki jest bazowy complexType przywiazany do tabeli Procesy5
  2274. @2015-10-25 pokazuje blednie 2 rekordy, wiec zamieniamy na pokazanie ostatniego elementu z derewiacji
  2275. nie dziala produkcyjnie system_cache__appinfo:trigger_on_insert itp.. -->
  2276. <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">
  2277. <xsl:variable name="system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table">
  2278. <xsl:apply-templates mode="p5_tr_map:detect_parent_complexType_with_ref_to_procesy5_table_multi" select="current()"/>
  2279. </xsl:variable>
  2280. <!--<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>-->
  2281. <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)]">
  2282. <xsl:copy-of select="."/>
  2283. </xsl:for-each>
  2284. </xsl:template>
  2285. <!--<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">
  2286. <xsl:message>#2293 TODO modify mode from #all to directed mode! in mode </xsl:message>
  2287. <xsl:apply-templates mode="#current"/>
  2288. </xsl:template>-->
  2289. <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">
  2290. <!--<xsl:message>#2335 Matched element</xsl:message>-->
  2291. <xsl:apply-templates mode="#current"/>
  2292. </xsl:template>
  2293. <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">
  2294. <xsl:apply-templates mode="#current">
  2295. <xsl:with-param name="p5_tr_map:ancestor-count" select="1"/>
  2296. </xsl:apply-templates>
  2297. </xsl:template>
  2298. <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">
  2299. <xsl:apply-templates mode="#current"/>
  2300. </xsl:template>
  2301. <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">
  2302. <xsl:apply-templates mode="#current"/>
  2303. </xsl:template>
  2304. <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">
  2305. <xsl:apply-templates mode="#current"/>
  2306. </xsl:template>
  2307. <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">
  2308. <xsl:apply-templates mode="#current"/>
  2309. </xsl:template>
  2310. <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">
  2311. <xsl:apply-templates mode="#current"/>
  2312. </xsl:template>
  2313. <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">
  2314. <xsl:apply-templates mode="#current"/>
  2315. </xsl:template>
  2316. <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">
  2317. <xsl:apply-templates mode="#current"/>
  2318. </xsl:template>
  2319. <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">
  2320. <xsl:apply-templates mode="#current"/>
  2321. </xsl:template>
  2322. <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">
  2323. <!--<xsl:message>#2372 matched <xsl:value-of select="@event_type"/></xsl:message>-->
  2324. <xsl:apply-templates mode="#current"/>
  2325. </xsl:template>
  2326. <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">
  2327. <xsl:apply-templates mode="#current"/>
  2328. </xsl:template>
  2329. <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">
  2330. <xsl:apply-templates mode="#current"/>
  2331. </xsl:template>
  2332. <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">
  2333. <xsl:apply-templates mode="#current"/>
  2334. </xsl:template>
  2335. <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">
  2336. <xsl:choose>
  2337. <xsl:when test="*">
  2338. <xsl:choose>
  2339. <xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2340. <xsl:comment>#1404 element go_recurse_from_root_by_build_element</xsl:comment>
  2341. <xsl:apply-templates mode="#current"/>
  2342. </xsl:when>
  2343. <xsl:when test="@event_type='434'">
  2344. <xsl:apply-templates mode="#current"/>
  2345. </xsl:when>
  2346. <xsl:when test="@event_type='710'">
  2347. <xsl:apply-templates mode="#current"/>
  2348. </xsl:when>
  2349. <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') -->
  2350. <xsl:element name="system_cache__appinfo:detect_parent_complexType_with_ref_to_procesy5_table"><xsl:value-of select="concat(@system_cache__appinfo:prefix,':',@system_cache__appinfo:name)"/></xsl:element>
  2351. <xsl:variable name="current" select="."/>
  2352. <xsl:for-each select="*[@event_type='473']">
  2353. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2354. <xsl:attribute name="event_type_to" select="$current/@event_type"/>
  2355. <xsl:attribute name="event_type" select="@event_type"/>
  2356. <xsl:attribute name="comment" select="'pierwszy warunek 494 bez dziecka 494'"/>
  2357. <xsl:element name="from_table">
  2358. <xsl:attribute name="table" select="@system_cache__appinfo:id"/>
  2359. <xsl:attribute name="src_desc" select="concat(@local-name,',',@system_cache__appinfo:name,',',@local-name-name)"/>
  2360. <xsl:attribute name="field_read" select="'ID'"/>
  2361. </xsl:element>
  2362. <xsl:element name="to_table">
  2363. <xsl:attribute name="name" select="$current/@system_cache__appinfo:id"/>
  2364. <xsl:attribute name="dst_desc" select="concat($current/@local-name,',',$current/@system_cache__appinfo:name,',',$current/@local-name-name)"/>
  2365. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2366. </xsl:element>
  2367. </xsl:element>
  2368. </xsl:for-each>
  2369. <xsl:apply-templates mode="#current"/>
  2370. </xsl:when>
  2371. <xsl:when test="@event_type='4941' or @event_type='4942'">
  2372. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2373. <xsl:attribute name="event_type_to" select="child::node()/@event_type"/>
  2374. <xsl:attribute name="event_type" select="@event_type"/>
  2375. <xsl:attribute name="comment" select="'drugi warunek 494 samo'"/>
  2376. <xsl:element name="from_table">
  2377. <xsl:attribute name="table" select="child::node()/@system_cache__appinfo:id"/>
  2378. <xsl:attribute name="src_desc" select="child::node()/@system_cache__appinfo:name"/>
  2379. <xsl:attribute name="field_read" select="'ID'"/>
  2380. </xsl:element>
  2381. <xsl:element name="to_table">
  2382. <xsl:attribute name="name" select="@system_cache__appinfo:id"/>
  2383. <xsl:attribute name="dst_desc" select="@system_cache__appinfo:name"/>
  2384. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2385. </xsl:element>
  2386. </xsl:element>
  2387. <xsl:apply-templates mode="#current"/>
  2388. </xsl:when>
  2389. <xsl:when test="@event_type='473' or @event_type='481' or @event_type='4810'">
  2390. <xsl:variable name="current" select="."/>
  2391. <xsl:for-each select="*[@event_type='477' or @event_type='477b']">
  2392. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2393. <xsl:attribute name="event_type_to" select="$current/@event_type"/>
  2394. <xsl:attribute name="event_type" select="@event_type"/>
  2395. <xsl:attribute name="comment" select="'trzeci warunek 473 lub 481 w petli'"/>
  2396. <xsl:element name="from_table">
  2397. <xsl:attribute name="table" select="@system_cache__appinfo:id"/>
  2398. <xsl:attribute name="src_desc" select="concat(@local-name,',',@system_cache__appinfo:name,',',@local-name-name)"/>
  2399. <xsl:attribute name="field_read" select="'ID'"/>
  2400. </xsl:element>
  2401. <xsl:element name="to_table">
  2402. <xsl:attribute name="name" select="$current/@system_cache__appinfo:id"/>
  2403. <xsl:attribute name="dst_desc" select="concat($current/@local-name,',',$current/@system_cache__appinfo:name,',',$current/@local-name-name)"/>
  2404. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2405. </xsl:element>
  2406. <xsl:variable name="current3023" select="."/>
  2407. <xsl:for-each select="*[@event_type='434']/system_cache__appinfo:go_recurse_from_root_by_build_element[@event_type='734']">
  2408. <xsl:element name="system_cache__appinfo:trigger_on_insert">
  2409. <xsl:attribute name="event_type_to" select="$current/@event_type"/>
  2410. <xsl:attribute name="event_type" select="@event_type"/>
  2411. <xsl:attribute name="comment" select="'zagniezdzony do trzeciego warunek poszukiwania natywnej tabeli procesy5 w petli'"/>
  2412. <xsl:element name="from_table">
  2413. <xsl:attribute name="table" select="concat(@system_cache__appinfo:prefix,':',@system_cache__appinfo:name)"/>
  2414. <xsl:attribute name="src_desc" select="concat(@local-name,',',@system_cache__appinfo:name,',',@local-name-name)"/>
  2415. <xsl:attribute name="field_read" select="'ID'"/>
  2416. </xsl:element>
  2417. <xsl:element name="to_table">
  2418. <xsl:attribute name="name" select="$current3023/@system_cache__appinfo:id"/>
  2419. <xsl:attribute name="dst_desc" select="concat($current3023/@local-name,',',$current3023/@system_cache__appinfo:name,',',$current3023/@local-name-name)"/>
  2420. <xsl:attribute name="field_set" select="'REMOTE_ID'"/>
  2421. </xsl:element>
  2422. </xsl:element>
  2423. </xsl:for-each>
  2424. </xsl:element>
  2425. </xsl:for-each>
  2426. </xsl:when>
  2427. </xsl:choose>
  2428. </xsl:when>
  2429. <xsl:otherwise><xsl:comment>#1489 other</xsl:comment></xsl:otherwise>
  2430. </xsl:choose>
  2431. </xsl:template>
  2432. <!-- @2015-04-23 template do stworzenia tabel dla obiektu na podstawie schematu obiektu - tabele instancyjne oraz z ID,PARENT_ID,REMOTE_ID -->
  2433. <!--@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">
  2434. <xsl:choose>
  2435. <xsl:when test="@event_type='477' or @event_type='477b'">
  2436. <!-\- <xsl:element name="sql_create_table">
  2437. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2438. 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 ;
  2439. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`,`REMOTE_ID`) values (0,0,0);-\->
  2440. <!-\-</xsl:element>-\->
  2441. </xsl:when>
  2442. <xsl:when test="@event_type='459b'">
  2443. <!-\- <xsl:element name="sql_create_table">
  2444. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2445. 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 ;
  2446. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`) values (0,0);-\->
  2447. <!-\-</xsl:element>-\->
  2448. </xsl:when>
  2449. <xsl:when test="@retrieve_TYPE or @requested-table-type='INSTANCE' and @system_cache__appinfo:id ">
  2450. <!-\- <xsl:element name="sql_create_table">
  2451. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2452. 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 ;
  2453. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`REMOTE_ID`) values (0,0);-\->
  2454. <!-\-</xsl:element>-\->
  2455. </xsl:when>
  2456. <xsl:when test="@system_cache__appinfo:id and @create_element and ( @local-name='element' or @local-name='attribute')">
  2457. <!-\- <xsl:element name="sql_create_table">
  2458. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2459. 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 ;
  2460. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`) values (0,0);-\->
  2461. <!-\-</xsl:element>-\->
  2462. </xsl:when>
  2463. <xsl:when test="@retrieve_REMOTE_ID and @system_cache__appinfo:id">
  2464. <!-\- <xsl:element name="sql_create_table">
  2465. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2466. 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 ;
  2467. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`,`REMOTE_ID`) values (0,0,0);-\->
  2468. <!-\-</xsl:element>-\->
  2469. </xsl:when>
  2470. <xsl:when test="(@retrieve_ID or @retrieve_PARENT_ID) and @system_cache__appinfo:id">
  2471. <!-\- <xsl:element name="sql_create_table">
  2472. <xsl:attribute name="system_cache__appinfo:sql_lang" select="'mysql'"/>-\->
  2473. 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 ;
  2474. <!-\-insert into `<xsl:value-of select="@retrieve_resource_id"/>` (`ID`,`PARENT_ID`) values (0,0);-\->
  2475. <!-\-</xsl:element>-\->
  2476. </xsl:when>
  2477. <xsl:when test="not(@*)"></xsl:when>
  2478. <xsl:otherwise>
  2479. <xsl:element name="ERROR_ELSE">
  2480. <xsl:for-each select="@*">
  2481. <xsl:attribute name="{name()}" select="."/>
  2482. </xsl:for-each>
  2483. <!-\-<xsl:copy-of select="."/>-\->
  2484. </xsl:element>
  2485. </xsl:otherwise>
  2486. </xsl:choose>
  2487. <xsl:apply-templates mode="#current"/>
  2488. </xsl:template>-->
  2489. <!-- @2015-09-25 template do znalezienia root sequence id - np. dla OBSZAR jest to OBSZAR/LOKALIZACJA
  2490. na wejsciu system_cache__appinfo:go_recurse_from_root_by_build_element. Poprawiono dla sciezki terc:WOJ 434d/494d/473 -->
  2491. <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">
  2492. <xsl:choose>
  2493. <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') -->
  2494. <xsl:element name="system_cache__appinfo:detect_root_sequence_id">
  2495. <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"/>
  2496. </xsl:element>
  2497. </xsl:when>
  2498. <xsl:when test="@event_type='434' or @event_type='434d' or @event_type='434er'">
  2499. <xsl:apply-templates mode="#current"/>
  2500. </xsl:when>
  2501. <xsl:when test="@event_type='4941' or @event_type='4942'">
  2502. <xsl:apply-templates mode="#current"/>
  2503. </xsl:when>
  2504. <xsl:when test="@event_type='710'">
  2505. <xsl:apply-templates mode="#current"/>
  2506. </xsl:when>
  2507. <xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2508. <xsl:apply-templates mode="#current"/>
  2509. </xsl:when>
  2510. </xsl:choose>
  2511. </xsl:template>
  2512. <xsl:template mode="p5_tr_map:detect_root_sequence_id" match="@*"/>
  2513. <!-- @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 -->
  2514. <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">
  2515. <!--<xsl:message>#2567 Matched element <xsl:value-of select="name()"/> with @event_type=<xsl:value-of select="@event_type"/></xsl:message>-->
  2516. <xsl:choose>
  2517. <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'">
  2518. <xsl:element name="system_cache__appinfo:detect_element_local_elements_without_ref_elements">
  2519. <xsl:for-each select="@*">
  2520. <xsl:attribute name="{name()}" select="."/>
  2521. </xsl:for-each>
  2522. <xsl:apply-templates mode="#current"/>
  2523. </xsl:element>
  2524. </xsl:when>
  2525. <xsl:when test="@event_type='428' or @event_type='428a' or @event_type='459'">
  2526. <xsl:element name="system_cache__appinfo:detect_element_local_elements_without_ref_elements">
  2527. <xsl:for-each select="@*">
  2528. <xsl:attribute name="{name()}" select="."/>
  2529. </xsl:for-each>
  2530. <xsl:apply-templates mode="#current"/>
  2531. </xsl:element>
  2532. </xsl:when>
  2533. <xsl:when test="local-name()='go_recurse_from_root_by_build_element'">
  2534. <xsl:apply-templates mode="#current"/>
  2535. </xsl:when>
  2536. </xsl:choose>
  2537. </xsl:template>
  2538. <!-- @2015-11-26 bindera: funkcja do zastapienia system_cache__appinfo:objects_parent_relation w celu wyswietlenia prawidlowej sekwencji derewiacji -->
  2539. <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">
  2540. <xsl:message>#2602 DEBUG matched name()=<xsl:value-of select="name()"/>; @event_type=<xsl:value-of select="@event_type"/>;</xsl:message>
  2541. <xsl:choose>
  2542. <xsl:when test="@event_type='434' or @event_type='434d' or @event_type='434er'">
  2543. <xsl:apply-templates mode="#current"/>
  2544. </xsl:when>
  2545. <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'">
  2546. <xsl:element name="p5_tr_map:derivations">
  2547. <xsl:apply-templates mode="p5_tr_map:objects_derivations_attrs" select="@*"/>
  2548. </xsl:element>
  2549. <xsl:apply-templates mode="#current"/>
  2550. </xsl:when>
  2551. </xsl:choose>
  2552. </xsl:template>
  2553. <xsl:template match="@system_cache__appinfo:name|@system_cache__appinfo:id|@local-name" mode="p5_tr_map:objects_derivations_attrs">
  2554. <xsl:attribute name="{name()}" select="."/>
  2555. </xsl:template>
  2556. <xsl:template match="@system_cache__appinfo:prefix" mode="p5_tr_map:objects_derivations_attrs">
  2557. <xsl:attribute name="{name()}" select="."/>
  2558. <xsl:attribute name="p5_tr_map:name_with_pref" select="concat(.,':',../@system_cache__appinfo:name)"/>
  2559. <xsl:attribute name="system_cache__appinfo:xpath_full" select="../@system_cache__appinfo:xpath_full"/>
  2560. </xsl:template>
  2561. <xsl:template match="@*" mode="p5_tr_map:objects_derivations_attrs"/>
  2562. <!-- @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 ,
  2563. bazuje na template @mode=system_cache__appinfo:empty_element_from_xsd_form -->
  2564. <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">
  2565. <xsl:param name="system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table" required="no"/>
  2566. <xsl:param name="parent_choice_name"/><!-- do oznaczania w przypadku choice aby dzieci mialy wspolne name -->
  2567. <xsl:variable name="node_3406" select="."/>
  2568. <!-- tutaj dajemy
  2569. <system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table>
  2570. <system_cache__appinfo:flat_element-to-object_element system_cache__appinfo:flat_element="ID"
  2571. system_cache__appinfo:object_element="ID"
  2572. system_cache__appinfo:id="default_default_objects_types___d20e438-id"
  2573. system_cache__appinfo:xpath="default_default_objects_types:LOKALIZACJA/ID"/>
  2574. />
  2575. -->
  2576. <xsl:choose>
  2577. <xsl:when test="@event_type='992'">
  2578. 992</xsl:when>
  2579. <xsl:when test="@event_type='467'"> <!-- element instancyjny -->
  2580. <xsl:apply-templates mode="#current">
  2581. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2582. <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"/>
  2583. </xsl:apply-templates>
  2584. </xsl:when>
  2585. <xsl:when test="@event_type='4812'"> <!-- element instancyjny - kilka dereviacji, ta jest pierwsza -->
  2586. <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),']')"/>{
  2587. <xsl:apply-templates mode="#current">
  2588. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2589. <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"/>
  2590. </xsl:apply-templates>
  2591. }
  2592. </xsl:when>
  2593. <xsl:when test="@event_type='1069'"> <!-- element instancyjny - z ref / simpleContent -->
  2594. <xsl:apply-templates mode="#current">
  2595. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2596. <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"/>
  2597. </xsl:apply-templates>
  2598. </xsl:when>
  2599. <xsl:when test="@event_type='459b'"> <!-- element instancyjny - z ref / simpleContent -->
  2600. 459b
  2601. </xsl:when>
  2602. <xsl:when test="@event_type='477' or @event_type='477b'">
  2603. <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>
  2604. <xsl:when test="@event_type='428'"> <!-- simple type -->
  2605. <!--428 @system_cache__appinfo:id:<xsl:value-of select="@system_cache__appinfo:id"/>-->
  2606. <xsl:for-each select="$system_cache__appinfo:detect_local-elements_relations_references_with_flat_procesy5_table/system_cache__appinfo:flat_element-to-object_element">
  2607. <!-- 3447,<xsl:value-of select="@system_cache__appinfo:xpath"/>-<xsl:value-of select="$node_3406/@system_cache__appinfo:xpath"/>-->
  2608. <xsl:if test="$node_3406/@system_cache__appinfo:xpath=@system_cache__appinfo:xpath"> <!-- $node_3406/@system_cache__appinfo:xpath= -->
  2609. <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="' '"/>
  2610. </xsl:if>
  2611. </xsl:for-each>
  2612. </xsl:when>
  2613. <xsl:when test="@event_type='720'"><xsl:text>&#xa;</xsl:text>@<xsl:value-of select="@local-name-name"/>, </xsl:when>
  2614. <xsl:when test="@event_type='734'"> <!-- natywna tabela plaska np. default_db-->
  2615. // 734 natywna tabela plaska np. default_db
  2616. </xsl:when>
  2617. <xsl:when test="@event_type='473' and @local-name='choice'"> <!-- choice -->
  2618. <xsl:variable name="parent_choice_name" select="generate-id()"/>
  2619. <!--<input type="radio" name="{$parent_choice_name}" value="{$parent_choice_name}"></input>-->
  2620. <xsl:text>&#xa;</xsl:text>choice:<xsl:value-of select="@retrieve_resource_id"/>{
  2621. <xsl:apply-templates mode="#current">
  2622. <xsl:with-param name="parent_choice_name" select="@system_cache__appinfo:id"/>
  2623. <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"/>
  2624. </xsl:apply-templates> }
  2625. </xsl:when>
  2626. <xsl:when test="@event_type='473' and @local-name!='choice'"> <!-- sequence -->
  2627. <xsl:text>&#xa;</xsl:text>sequence:<xsl:value-of select="@retrieve_resource_id"/>{
  2628. <xsl:apply-templates mode="#current">
  2629. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2630. <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"/>
  2631. </xsl:apply-templates> }
  2632. </xsl:when>
  2633. <xsl:otherwise>
  2634. <!--<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>-->
  2635. <xsl:apply-templates mode="#current">
  2636. <xsl:with-param name="parent_choice_name" select="$parent_choice_name"/>
  2637. <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"/>
  2638. </xsl:apply-templates>
  2639. </xsl:otherwise>
  2640. </xsl:choose>
  2641. </xsl:template>
  2642. <xsl:template match="comment()|text()" mode="#all"/>
  2643. </xsl:stylesheet>