get_all_xsd.xsl 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. exclude-result-prefixes="xs hfp"
  5. version="2.0"
  6. xmlns:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
  7. xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  8. 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"
  9. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  10. xmlns:p5opr="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/object_parent_relations/object_parent_relations.xsd"
  11. xmlns:p5_simpleSchema_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/p5_simpleSchema_map.xsd"
  12. xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty"
  13. xmlns:ant-object="http://biuro.biall-net.pl/xmlschema_procesy5/ant-object/ant-object.xsd"
  14. xmlns:p5ant-interface="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/ant_interface/ant_interface.xsd"
  15. >
  16. <xsl:import href="system_cache__appinfo/vrtfNamespaces.xsl"/>
  17. <xsl:import href="p5_tr_map/element-filename.xsl"/>
  18. <xsl:import href="object_parent_relations/element-filename.xsl"/> <!-- param name="p5opr:detect_objects_parent_relations.local" required="yes" -->
  19. <xsl:import href="system_cache__appinfo/basedir.xsl"/>
  20. <xsl:include href="p5_simpleSchema_map/element-filename.xsl"/>
  21. <xsl:include href="../ant-object/default_db.ant-object.basedir.xsl"/>
  22. <xsl:include href="../ant-object/ant-object.xsl"/>
  23. <!--<xsl:import href="system_cache__appinfo/element-filename.xsl"/>-->
  24. <xsl:output indent="yes"/>
  25. <xsl:strip-space elements="*"/>
  26. <xsl:param name="vc:minVersion" select="'1.1'" />
  27. <xsl:param name="vc:maxVersion"/>
  28. <xsl:param name="procesy5_system_schema" select="'../default_db.instance.xml/transformed/procesy5_system_schema.xml'"/>
  29. <xsl:param name="procesy5_system_schema_collection_dir" select="'../'"/>
  30. <xsl:param name="cache" select="'read'"/>
  31. <xsl:param name="targetNamespace_DEFAULTS" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db'"/>
  32. <xsl:param name="external_schema" required="yes" /> <!-- select="'/public_html/external_schema'" -->
  33. <xsl:param name="external_schema_id_namespace_prefix" select="'/public_html/external_schema_id_namespace_prefix'"/>
  34. <xsl:param name="XMLSchema_prefix" select="'xs'"/>
  35. <xsl:param name="external_schema_table.path" required="yes"/>
  36. <xsl:param name="default_db.dir" required="yes" /> <!-- select="'/public_html/default_db/'" -->
  37. <xsl:param name="default_db_xml_cache.public" required="yes"/><!-- select="'/public_html/default_db_xml_cache.public/'" -->
  38. <xsl:param name="targetNamespace_DEFAULTS_prefix" select="'default_db'"/>
  39. <xsl:param name="WPS_Functions" required="yes" /><!-- select="'public_html/WPS_Functions/'" -->
  40. <xsl:param name="new-schema-with-ID-to-move-and-rename-to-xsd" select="'/new-schema-with-ID-to-move-and-rename-to-xsd'"/>
  41. <xsl:param name="default_db.instance.xml" required="yes"/> <!-- todo better always include get_all_xsd -->
  42. <xsl:param name="p5build_SE.INSTALL_ROOT.repository.symlink" select="'/repository.symlink/'"/>
  43. <xsl:param name="p5Type.basedir" required="yes"/> <!-- select="'public_html/Types/'" -->
  44. <xsl:include href="../default_db_xml_cache.public/xml-schema-primitives.xsl"/>
  45. <xsl:include href="system_cache__appinfo/external_schema_targetNamespace.xsl"/>
  46. <xsl:include href="system_cache__appinfo/functions.xsl"/>
  47. <xsl:include href="system_cache__resources_tree_generate_xsl_required_occurs_raport/element-filename.xsl"/>
  48. <xsl:include href="system_cache__resources_tree_generate_xsl_required_occurs_raport/detect_resource_type.local.xsl"/>
  49. <xsl:include href="system_cache__appinfo/element-filename.xsl"/>
  50. <xsl:attribute-set name="p5ant-interface:xslt.param.get_all_xsd_list">
  51. <xsl:attribute name="default_db.ant-object.basedir" select="$default_db.ant-object.basedir"/>
  52. </xsl:attribute-set>
  53. <xsl:template name="main">
  54. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  55. <xsl:with-param name="path2collection" select="'../'"/>
  56. <xsl:with-param name="cache" select="'read'"/>
  57. </xsl:call-template>
  58. </xsl:template>
  59. <!-- BEGIN external schema templates -->
  60. <!-- <xsl:template match="get_all_xsd_list" mode="system_cache__appinfo:get_all_xsd_external_schema__equals" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
  61. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema__equals"/>
  62. </xsl:template>
  63. <xsl:template match="get_all_xsd|get_all_xsd_external_schema_id_namespace_prefix" mode="system_cache__appinfo:get_all_xsd_external_schema__equals" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"/>
  64. <xsl:template match="get_all_xsd_external_schema" mode="system_cache__appinfo:get_all_xsd_external_schema__equals" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
  65. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema__equals"/>
  66. </xsl:template>
  67. -->
  68. <xsl:template match="complexType" mode="system_cache__appinfo:get_all_xsd_default_db__equals" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" >
  69. <xsl:param name="system_cache__appinfo:get_all_xsd.row" required="yes"/>
  70. <xsl:if test="not($system_cache__appinfo:get_all_xsd.row/*)">
  71. <not_equals>
  72. <xsl:attribute name="empty" select="@name"/>
  73. </not_equals>
  74. </xsl:if>
  75. <xsl:variable name="system_cache__appinfo:get_all_xsd.row">
  76. <var>
  77. <xsl:for-each select="$system_cache__appinfo:get_all_xsd.row/*">
  78. <xsl:element name="{name()}">
  79. <xsl:attribute name="pos" select="position()"/>
  80. <xsl:copy-of select="@*"/>
  81. <xsl:copy-of select="*"/>
  82. </xsl:element>
  83. </xsl:for-each>
  84. </var>
  85. </xsl:variable>
  86. <system_cache__appinfo:get_all_xsd_default_db__equals>
  87. <xsl:copy-of select="@*"/>
  88. <xsl:call-template name="system_cache__appinfo:get_all_xsd_default_db__equals">
  89. <xsl:with-param name="system_cache__appinfo:get_all_xsd_default_db" select=".[*]"/>
  90. <xsl:with-param name="system_cache__appinfo:get_all_xsd.row" select="$system_cache__appinfo:get_all_xsd.row"/>
  91. </xsl:call-template>
  92. <!--<system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
  93. <xsl:copy-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix"></xsl:copy-of>
  94. </system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>-->
  95. </system_cache__appinfo:get_all_xsd_default_db__equals>
  96. </xsl:template>
  97. <xsl:template match="system_cache__appinfo:get_all_xsd_external_schema" mode="system_cache__appinfo:get_all_xsd_external_schema__equals" >
  98. <xsl:param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" required="yes"/>
  99. <xsl:variable name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix">
  100. <var>
  101. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/*">
  102. <xsl:message>#111 @name=<xsl:value-of select="@name"/>; name()=<xsl:value-of select="name()"/></xsl:message>
  103. <xsl:element name="{name()}">
  104. <xsl:attribute name="pos" select="position()"/>
  105. <xsl:copy-of select="@*"/>
  106. <xsl:copy-of select="*"/>
  107. </xsl:element>
  108. </xsl:for-each>
  109. </var>
  110. </xsl:variable>
  111. <system_cache__appinfo:get_all_xsd_external_schema__equals>
  112. <xsl:copy-of select="@*"/>
  113. <xsl:call-template name="system_cache__appinfo:get_all_xsd_external_schema__equals">
  114. <xsl:with-param name="system_cache__appinfo:get_all_xsd_external_schema" select=".[*]"/>
  115. <xsl:with-param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix"/>
  116. </xsl:call-template>
  117. <!--<system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
  118. <xsl:copy-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix"></xsl:copy-of>
  119. </system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>-->
  120. </system_cache__appinfo:get_all_xsd_external_schema__equals>
  121. </xsl:template>
  122. <!--<xsl:template match="schema" mode="system_cache__appinfo:get_all_xsd_external_schema__equals" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  123. <xsl:param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" required="yes"/>
  124. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema__equals">
  125. <xsl:with-param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/*"/>
  126. </xsl:apply-templates>
  127. </xsl:template>-->
  128. <xsl:template name="system_cache__appinfo:get_all_xsd_default_db__equals" >
  129. <xsl:param name="system_cache__appinfo:get_all_xsd_default_db" required="yes"/>
  130. <xsl:param name="system_cache__appinfo:get_all_xsd.row" required="yes"/>
  131. <!--<pre_external_schema>
  132. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema/*">
  133. <xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element>
  134. </xsl:for-each>
  135. </pre_external_schema>
  136. <pre_schema_id_namespace_prefix>
  137. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*">
  138. <xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element>
  139. </xsl:for-each>
  140. </pre_schema_id_namespace_prefix>-->
  141. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_default_db/*">
  142. <xsl:variable name="position" select="position()"/>
  143. <xsl:comment> Try position <xsl:value-of select="$position"/>;</xsl:comment>
  144. <xsl:choose>
  145. <!--<xsl:when test="not($position = $pos)">
  146. <not_pos>
  147. <xsl:attribute name="pos" select="$pos"/>
  148. <xsl:attribute name="position" select="$position"/>
  149. <xsl:attribute name="expected" select="local-name()"/>
  150. </not_pos>
  151. </xsl:when>-->
  152. <xsl:when test="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/local-name() = local-name()">
  153. <equals>
  154. <xsl:attribute name="position" select="position()"/>
  155. <xsl:attribute name="expected" select="local-name()"/>
  156. <xsl:attribute name="found" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/local-name()"/>
  157. <xsl:attribute name="found.name" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/@name"/>
  158. <xsl:attribute name="first_el_par" select="$system_cache__appinfo:get_all_xsd.row/var[1]/name()"/>
  159. </equals>
  160. <!--<xsl:message>#170 comp equal <xsl:value-of select="local-name()"/> === <xsl:value-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix[ position() = $position]/local-name()"/></xsl:message>-->
  161. </xsl:when>
  162. <xsl:otherwise>
  163. <not_equals>
  164. <xsl:attribute name="position" select="position()"/>
  165. <xsl:attribute name="expected" select="local-name()"/>
  166. <xsl:attribute name="expected.name" select="@name"/>
  167. <xsl:attribute name="found" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/local-name()"/>
  168. <xsl:attribute name="found.name" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/@name"/>
  169. <xsl:attribute name="found_id" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/@id"/>
  170. <xsl:attribute name="found_pos" select="$system_cache__appinfo:get_all_xsd.row/var/*[ @pos = $position]/@pos"/>
  171. <xsl:attribute name="first_el_par" select="$system_cache__appinfo:get_all_xsd.row/var/*[1]/name()"/>
  172. </not_equals>
  173. </xsl:otherwise>
  174. </xsl:choose>
  175. <!--<child>-->
  176. <xsl:variable name="system_cache__appinfo:get_all_xsd_default_db_new">
  177. <var>
  178. <xsl:for-each select="$system_cache__appinfo:get_all_xsd.row/var/*[@pos=$position]/*">
  179. <xsl:element name="{name()}">
  180. <xsl:attribute name="pos" select="position()"/>
  181. <xsl:copy-of select="@*"/>
  182. <xsl:copy-of select="*"/>
  183. </xsl:element>
  184. </xsl:for-each>
  185. </var>
  186. </xsl:variable>
  187. <!--<test_var_new><xsl:copy-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix_new"/></test_var_new>-->
  188. <xsl:call-template name="system_cache__appinfo:get_all_xsd_default_db__equals">
  189. <xsl:with-param name="system_cache__appinfo:get_all_xsd_default_db" select=".[*]"/>
  190. <xsl:with-param name="system_cache__appinfo:get_all_xsd.row" select="$system_cache__appinfo:get_all_xsd_default_db_new/.[*]"/>
  191. </xsl:call-template>
  192. <!--</child>-->
  193. </xsl:for-each>
  194. </xsl:template>
  195. <xsl:template name="system_cache__appinfo:get_all_xsd_external_schema__equals" >
  196. <xsl:param name="system_cache__appinfo:get_all_xsd_external_schema" required="yes"/>
  197. <xsl:param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" required="yes"/>
  198. <!--<pre_external_schema>
  199. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema/*">
  200. <xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element>
  201. </xsl:for-each>
  202. </pre_external_schema>
  203. <pre_schema_id_namespace_prefix>
  204. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*">
  205. <xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element>
  206. </xsl:for-each>
  207. </pre_schema_id_namespace_prefix>-->
  208. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema/*">
  209. <xsl:variable name="position" select="position()"/>
  210. <xsl:comment> Try position <xsl:value-of select="$position"/>;</xsl:comment>
  211. <xsl:choose>
  212. <!--<xsl:when test="not($position = $pos)">
  213. <not_pos>
  214. <xsl:attribute name="pos" select="$pos"/>
  215. <xsl:attribute name="position" select="$position"/>
  216. <xsl:attribute name="expected" select="local-name()"/>
  217. </not_pos>
  218. </xsl:when>-->
  219. <xsl:when test="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*[ @pos = $position]/local-name() = local-name()">
  220. <!--<equals>
  221. <xsl:attribute name="position" select="position()"/>
  222. <xsl:attribute name="expected" select="local-name()"/>
  223. <xsl:attribute name="found" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*[ @pos = $position]/local-name()"/>
  224. <xsl:attribute name="first_el_par" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var[1]/name()"/>
  225. </equals>-->
  226. <!--<xsl:message>#170 comp equal <xsl:value-of select="local-name()"/> === <xsl:value-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix[ position() = $position]/local-name()"/></xsl:message>-->
  227. </xsl:when>
  228. <xsl:otherwise>
  229. <not_equals>
  230. <xsl:attribute name="position" select="position()"/>
  231. <xsl:attribute name="expected" select="local-name()"/>
  232. <xsl:attribute name="found" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*[ @pos = $position]/local-name()"/>
  233. <xsl:attribute name="found_id" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*[ @pos = $position]/@id"/>
  234. <xsl:attribute name="found_pos" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*[ @pos = $position]/@pos"/>
  235. <xsl:attribute name="first_el_par" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*[1]/name()"/>
  236. </not_equals>
  237. </xsl:otherwise>
  238. </xsl:choose>
  239. <!--<child>-->
  240. <xsl:variable name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix_new">
  241. <var>
  242. <xsl:for-each select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix/var/*[@pos=$position]/*">
  243. <xsl:element name="{name()}">
  244. <xsl:attribute name="pos" select="position()"/>
  245. <xsl:copy-of select="@*"/>
  246. <xsl:copy-of select="*"/>
  247. </xsl:element>
  248. </xsl:for-each>
  249. </var>
  250. </xsl:variable>
  251. <!--<test_var_new><xsl:copy-of select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix_new"/></test_var_new>-->
  252. <xsl:call-template name="system_cache__appinfo:get_all_xsd_external_schema__equals">
  253. <xsl:with-param name="system_cache__appinfo:get_all_xsd_external_schema" select=".[*]"/>
  254. <xsl:with-param name="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" select="$system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix_new/.[*]"/>
  255. </xsl:call-template>
  256. <!--</child>-->
  257. </xsl:for-each>
  258. </xsl:template>
  259. <xsl:template match="schema" mode="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  260. <xsl:param name="system_cache__appinfo:document-uri" required="yes"/>
  261. <xsl:variable name="targetNamespace" select="@targetNamespace"/>
  262. <xsl:variable name="namespaces_cur">
  263. <namespaces_cur>
  264. <xsl:for-each select="namespace::node()">
  265. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  266. </xsl:for-each>
  267. </namespaces_cur>
  268. </xsl:variable>
  269. <xsl:element name="schema" namespace="http://www.w3.org/2001/XMLSchema" extension-element-prefixes="#default" inherit-namespaces="yes">
  270. <xsl:choose>
  271. <xsl:when test="@targetNamespace and ( not($namespaces_cur//ns[@uri=$targetNamespace]/@prefix) or $namespaces_cur//ns[@uri=$targetNamespace]/@prefix='' ) " xpath-default-namespace="">
  272. <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
  273. <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace(@targetNamespace)"/>
  274. <xsl:copy-of select="namespace::node()"/>
  275. <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
  276. <xsl:copy-of select="@targetNamespace"/>
  277. <xsl:if test="$vc:minVersion"><xsl:attribute name="vc:minVersion" select="$vc:minVersion"/></xsl:if>
  278. <xsl:if test="$vc:maxVersion"><xsl:attribute name="vc:maxVersion" select="$vc:maxVersion"/></xsl:if>
  279. <xsl:comment>#144 when @targetNamespace exists and prefix not exists</xsl:comment>
  280. <xsl:comment>namespaces_cur/ns/@uri=<xsl:value-of select="$targetNamespace"/> = <xsl:value-of select="$namespaces_cur/namespaces_cur/ns[@uri=$targetNamespace]/@prefix"/> </xsl:comment>
  281. <xsl:comment> count: <xsl:value-of select="count($namespaces_cur/namespaces_cur/ns)"/> </xsl:comment>
  282. <xsl:copy-of select="*"/>
  283. </xsl:when>
  284. <xsl:when test="@targetNamespace">
  285. <xsl:variable name="detect_prefix" select="$namespaces_cur//ns[@uri=$targetNamespace]/@prefix" xpath-default-namespace=""/>
  286. <xsl:namespace name="{$detect_prefix}" select="@targetNamespace"/>
  287. <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
  288. <xsl:copy-of select="namespace::node()"/>
  289. <xsl:copy-of select="@targetNamespace"/>
  290. <xsl:if test="$vc:minVersion"><xsl:attribute name="vc:minVersion" select="$vc:minVersion"/></xsl:if>
  291. <xsl:if test="$vc:maxVersion"><xsl:attribute name="vc:maxVersion" select="$vc:maxVersion"/></xsl:if>
  292. <xsl:comment>#147 when @targetNamespace and prefix probably exists!</xsl:comment>
  293. <xsl:copy-of select="*"/>
  294. </xsl:when>
  295. <xsl:otherwise>
  296. <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
  297. <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
  298. <xsl:copy-of select="namespace::node()"/>
  299. <xsl:namespace name="p5Type" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
  300. <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
  301. <xsl:if test="$vc:minVersion"><xsl:attribute name="vc:minVersion" select="$vc:minVersion"/></xsl:if>
  302. <xsl:if test="$vc:maxVersion"><xsl:attribute name="vc:maxVersion" select="$vc:maxVersion"/></xsl:if>
  303. <xsl:message>#35 detect. targetNamespace <xsl:value-of select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/></xsl:message>
  304. <xsl:comment>#158 otherwise not @targetNamespace and no prefix</xsl:comment>
  305. <xsl:copy-of select="*"/>
  306. </xsl:otherwise>
  307. </xsl:choose>
  308. </xsl:element>
  309. </xsl:template>
  310. <xsl:template match="schema" mode="system_cache__appinfo:get_all_xsd_external_schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  311. <xsl:param name="system_cache__appinfo:document-uri" required="yes"/>
  312. <xsl:variable name="targetNamespace" select="@targetNamespace"/>
  313. <xsl:variable name="namespaces_cur">
  314. <namespaces_cur>
  315. <xsl:for-each select="namespace::node()">
  316. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  317. </xsl:for-each>
  318. </namespaces_cur>
  319. </xsl:variable>
  320. <xsl:element name="schema" namespace="http://www.w3.org/2001/XMLSchema" extension-element-prefixes="#default" inherit-namespaces="yes">
  321. <xsl:choose>
  322. <xsl:when test="@targetNamespace and ( not($namespaces_cur//ns[@uri=$targetNamespace]/@prefix) or $namespaces_cur//ns[@uri=$targetNamespace]/@prefix='' ) " xpath-default-namespace="">
  323. <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
  324. <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace(@targetNamespace)"/>
  325. <xsl:copy-of select="namespace::node()"/>
  326. <xsl:copy-of select="@targetNamespace"/>
  327. <xsl:attribute name="vc:minVersion" select="'1.0'"/>
  328. <xsl:attribute name="vc:maxVersion" select="'1.1'"/>
  329. <xsl:comment>#144 when @targetNamespace exists and prefix not exists</xsl:comment>
  330. <xsl:comment>namespaces_cur/ns/@uri=<xsl:value-of select="$targetNamespace"/> = <xsl:value-of select="$namespaces_cur/namespaces_cur/ns[@uri=$targetNamespace]/@prefix"/> </xsl:comment>
  331. <xsl:comment> count: <xsl:value-of select="count($namespaces_cur/namespaces_cur/ns)"/> </xsl:comment>
  332. <!--<xsl:for-each select="$namespaces_cur/namespaces_cur/ns">
  333. <xsl:comment> ns @element=<xsl:value-of select="@element"/>; @prefix=<xsl:value-of select="@prefix"/>; @uri=<xsl:value-of select="@uri"/>;</xsl:comment>
  334. </xsl:for-each>-->
  335. <!-- <xs:debug>
  336. <xsl:copy-of select="$namespaces_cur"/>
  337. </xs:debug>
  338. <xs:debug_filter>
  339. <xsl:copy-of select="$namespaces_cur//ns[@uri=$targetNamespace]"/>
  340. </xs:debug_filter>
  341. <xs:debug_filter_NS>
  342. <xsl:copy-of select="$namespaces_cur//ns[@uri=$targetNamespace]" xpath-default-namespace=""/>
  343. </xs:debug_filter_NS>-->
  344. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace">
  345. <xsl:with-param name="detect_prefix" select="$detect_prefix"/>
  346. <xsl:with-param name="detect_targetNamespace" select="@targetNamespace"/>
  347. <xsl:with-param name="namespaces_cur" select="$namespaces_cur"/>
  348. </xsl:apply-templates>
  349. </xsl:when>
  350. <xsl:when test="@targetNamespace">
  351. <xsl:variable name="detect_prefix" select="$namespaces_cur//ns[@uri=$targetNamespace]/@prefix" xpath-default-namespace=""/>
  352. <xsl:namespace name="{$detect_prefix}" select="@targetNamespace"/>
  353. <xsl:copy-of select="namespace::node()"/>
  354. <xsl:copy-of select="@targetNamespace"/>
  355. <xsl:attribute name="vc:minVersion" select="'1.1'"/>
  356. <!--<xsl:attribute name="vc:maxVersion" select="'1.1'"/>-->
  357. <xsl:comment>#147 when @targetNamespace and prefix probably exists!</xsl:comment>
  358. <!--<xsl:copy-of select="*" copy-namespaces="yes"/>-->
  359. <!--<xs:debug_test>
  360. <xsl:value-of select="$namespaces_cur//ns[@uri=$targetNamespace]/@prefix"/>
  361. </xs:debug_test>
  362. <xs:debug>
  363. <xsl:copy-of select="$namespaces_cur"/>
  364. </xs:debug>
  365. <xs:debug_filter>
  366. <xsl:copy-of select="$namespaces_cur//ns[@uri=$targetNamespace]"/>
  367. </xs:debug_filter>
  368. <xs:debug_filter_NS>
  369. <xsl:copy-of select="$namespaces_cur//ns[@uri=$targetNamespace]" xpath-default-namespace=""/>
  370. </xs:debug_filter_NS>-->
  371. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_with_prefix"/>
  372. </xsl:when>
  373. <xsl:otherwise>
  374. <xsl:variable name="detect_prefix" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace_prefix($system_cache__appinfo:document-uri)"/>
  375. <xsl:namespace name="{$detect_prefix}" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
  376. <xsl:copy-of select="namespace::node()"/>
  377. <xsl:attribute name="targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
  378. <xsl:if test="$vc:minVersion"><xsl:attribute name="vc:minVersion" select="$vc:minVersion"/></xsl:if>
  379. <xsl:if test="$vc:maxVersion"><xsl:attribute name="vc:maxVersion" select="$vc:maxVersion"/></xsl:if>
  380. <!--<xsl:attribute name="vc:maxVersion" select="'1.1'"/>-->
  381. <xsl:message>#35 detect. targetNamespace <xsl:value-of select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/></xsl:message>
  382. <xsl:comment>#158 otherwise not @targetNamespace and no prefix</xsl:comment>
  383. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace">
  384. <xsl:with-param name="detect_prefix" select="$detect_prefix"/>
  385. <xsl:with-param name="detect_targetNamespace" select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($system_cache__appinfo:document-uri)"/>
  386. <xsl:with-param name="namespaces_cur" select="$namespaces_cur"/>
  387. </xsl:apply-templates>
  388. </xsl:otherwise>
  389. </xsl:choose>
  390. </xsl:element>
  391. </xsl:template>
  392. <xsl:template match="*" mode="system_cache__appinfo:get_all_xsd_external_schema_with_prefix" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  393. <xsl:element name="{$XMLSchema_prefix}:{local-name()}" namespace="http://www.w3.org/2001/XMLSchema">
  394. <xsl:apply-templates select="@*" mode="system_cache__appinfo:get_all_xsd_external_schema_with_prefix"/>
  395. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_with_prefix"/>
  396. </xsl:element>
  397. </xsl:template>
  398. <xsl:template mode="system_cache__appinfo:get_all_xsd_external_schema_with_prefix" match="@type|@base">
  399. <!-- sa bledy ze schematami z prefix xsd... -->
  400. <xsl:choose>
  401. <xsl:when test="contains(.,'xsd:')">
  402. <xsl:attribute name="{name()}" select="concat($XMLSchema_prefix,':', system_cache__appinfo:clean_object_prefix(.))"/>
  403. </xsl:when>
  404. <xsl:otherwise>
  405. <xsl:attribute name="{name()}" select="."/>
  406. </xsl:otherwise>
  407. </xsl:choose>
  408. </xsl:template>
  409. <xsl:template mode="system_cache__appinfo:get_all_xsd_external_schema_with_prefix" match="@*">
  410. <xsl:attribute name="{name()}" select="."/>
  411. </xsl:template>
  412. <xsl:template match="*" mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  413. <xsl:param name="detect_prefix" required="yes"/>
  414. <xsl:param name="detect_targetNamespace" required="yes"/>
  415. <xsl:param name="namespaces_cur" required="yes"/>
  416. <xsl:element name="{$XMLSchema_prefix}:{local-name()}" namespace="http://www.w3.org/2001/XMLSchema">
  417. <!--<xsl:attribute name="test_prefix" select="system_cache__appinfo:prefix_from_targetNamespace($namespaces_cur,'http://www.w3.org/2001/XMLSchema')"/>-->
  418. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace" select="@*">
  419. <xsl:with-param name="detect_prefix" select="$detect_prefix"/>
  420. <xsl:with-param name="namespaces_cur" select="$namespaces_cur"/>
  421. </xsl:apply-templates>
  422. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace">
  423. <xsl:with-param name="detect_prefix" select="$detect_prefix"/>
  424. <xsl:with-param name="detect_targetNamespace" select="$detect_targetNamespace"/>
  425. <xsl:with-param name="namespaces_cur" select="$namespaces_cur"/>
  426. </xsl:apply-templates>
  427. </xsl:element>
  428. </xsl:template>
  429. <xsl:template mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace" match="@type|@base">
  430. <!-- sa bledy ze schematami z prefix xsd... -->
  431. <xsl:param name="namespaces_cur" required="yes"/>
  432. <xsl:param name="detect_prefix" required="yes"/>
  433. <xsl:choose>
  434. <!--<xsl:when test="contains(.,'xsd:')">
  435. <xsl:attribute name="{name()}" select="concat($XMLSchema_prefix,':', system_cache__appinfo:clean_object_prefix(.))"/>
  436. </xsl:when>-->
  437. <xsl:when test="not(contains(.,':'))">
  438. <xsl:attribute name="{name()}" select="concat($detect_prefix,':',.)"/>
  439. </xsl:when>
  440. <xsl:when test="system_cache__appinfo:prefix_from_targetNamespace($namespaces_cur,'http://www.w3.org/2001/XMLSchema')=system_cache__appinfo:get_object_prefix(.)">
  441. <!--<xsl:message terminate="yes">#281 - wykryte ze jest to type XSD <xsl:value-of select="."/></xsl:message>-->
  442. <xsl:attribute name="{name()}" select="concat($XMLSchema_prefix,':', system_cache__appinfo:clean_object_prefix(.))"/>
  443. </xsl:when>
  444. <xsl:when test="contains(.,':')">
  445. <xsl:copy-of select="."/>
  446. </xsl:when>
  447. <xsl:otherwise>
  448. <xsl:message> #285 test : <xsl:value-of select="system_cache__appinfo:prefix_from_targetNamespace($namespaces_cur,'http://www.w3.org/2001/XMLSchema')"/> = <xsl:value-of select="system_cache__appinfo:get_object_prefix(.)"/> (<xsl:value-of select="."/>) ?</xsl:message>
  449. <xsl:attribute name="{name()}" select="concat($detect_prefix,':',.)"/>
  450. </xsl:otherwise>
  451. </xsl:choose>
  452. </xsl:template>
  453. <xsl:template mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace" match="@ref">
  454. <xsl:param name="namespaces_cur" required="yes"/>
  455. <xsl:param name="detect_prefix" required="yes"/>
  456. <xsl:attribute name="{name()}" select="concat($detect_prefix,':',.)"/>
  457. </xsl:template>
  458. <xsl:template mode="system_cache__appinfo:get_all_xsd_external_schema_not_targetNamespace" match="@*">
  459. <xsl:param name="namespaces_cur" required="yes"/>
  460. <xsl:attribute name="{name()}" select="."/>
  461. </xsl:template>
  462. <!-- EOF external schema templates -->
  463. <xsl:template name="system_cache__appinfo:get_all_xsd.verify_unique_id">
  464. <system_cache__appinfo:get_all_xsd.verify_unique_id>
  465. <xsl:variable name="system_cache__appinfo:get_all_xsd" select="doc($procesy5_system_schema)"/>
  466. <xsl:for-each select="$system_cache__appinfo:get_all_xsd//schema[ not(@targetNamespace='http://www.w3.org/2001/XMLSchema') and not(@targetNamespace='http://biuro.biall-net.pl/p5/schema/types')]//*[@id and position() &lt; 100] " xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  467. <xsl:message>#486 testing <xsl:value-of select="name()"/> and @id=<xsl:value-of select="@id"/></xsl:message>
  468. <xsl:choose>
  469. <xsl:when test="count($system_cache__appinfo:get_all_xsd//*[@id = current()/@id]) &gt; 1">
  470. <xsl:message terminate="yes">#489 error duplicate @id for <xsl:value-of select="@id"/> - element <xsl:value-of select="name()"/>/<xsl:value-of select="@name"/>
  471. </xsl:message>
  472. </xsl:when>
  473. </xsl:choose>
  474. </xsl:for-each>
  475. </system_cache__appinfo:get_all_xsd.verify_unique_id>
  476. </xsl:template>
  477. <xsl:template name="system_cache__appinfo:get_all_xsd">
  478. <xsl:param name="path2collection" select="$procesy5_system_schema_collection_dir"/>
  479. <xsl:param name="get_system_schemas"/>
  480. <xsl:param name="cache" select="$cache"/>
  481. <xsl:variable name="element-filename" select="'procesy5_system_schema'"/>
  482. <xsl:choose>
  483. <xsl:when test="unparsed-text-available(concat('../default_db.instance.xml/transformed/',$element-filename,'.xml')) and $cache='read'">
  484. <xsl:copy-of select="doc(concat('../default_db.instance.xml/transformed/',$element-filename,'.xml'))"/>
  485. </xsl:when>
  486. <xsl:otherwise>
  487. <xsl:variable name="path">
  488. <xsl:value-of select="concat($path2collection,'?select=*.(xsd);recurse=yes;on-error=fail;xinclude=no')"/>
  489. </xsl:variable>
  490. <xsl:variable name="docs" select="collection($path)"/>
  491. <xsl:variable name="procesy5_system_schema">
  492. <system_cache__appinfo:get_all_xsd_list xsl:use-attribute-sets="p5ant-interface:xslt.param.get_all_xsd_list"
  493. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  494. xsi:schemaLocation="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd ../../default_db_xml_cache.public/system_cache__appinfo/procesy5_system_schema.xsd">
  495. <xsl:for-each select="$docs">
  496. <xsl:message> get_all_xsd przetwarzam plik <xsl:value-of select="document-uri(/)"/></xsl:message>
  497. <xsl:choose>
  498. <xsl:when test="contains(document-uri(/),$p5build_SE.INSTALL_ROOT.repository.symlink)">
  499. <xsl:message>#555 ignored /$repository.symlink for <xsl:value-of select="document-uri(/)"/>"/> ;</xsl:message>
  500. </xsl:when>
  501. <xsl:when test="contains(document-uri(/),'/ant-object/') and ant-object:location__x3A__default_db.validate($default_db.ant-object.basedir,document-uri(/))">
  502. <xsl:message>#519 NOT default_db ignored TESTING /ant-object for <xsl:value-of select="document-uri(/)"/>"/> ;</xsl:message>
  503. <xsl:comment>#519 NOT default_db ignored TESTING /ant-object test:
  504. <xsl:value-of select="ant-object:location__x3A__default_db.validate($default_db.ant-object.basedir,document-uri(/))"/>
  505. </xsl:comment>
  506. <system_cache__appinfo:get_all_xsd debug="@2019-08 problem if should be _default_db"><!-- _default_db -->
  507. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $basedir)"/><!-- $default_db.ant-object.basedir -->
  508. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  509. <xsl:call-template name="ant-object:location__x3A__default_db.validate">
  510. <xsl:with-param name="document-uri" select="document-uri(/)"/>
  511. <xsl:with-param name="default_db.ant-object.basedir" select="$default_db.ant-object.basedir"/>
  512. </xsl:call-template>
  513. <xsl:copy-of select="/"/>
  514. </system_cache__appinfo:get_all_xsd>
  515. </xsl:when>
  516. <xsl:when test="contains(document-uri(/),'/ant-object/') and not(ant-object:location__x3A__default_db.validate($default_db.ant-object.basedir,document-uri(/)))">
  517. <xsl:message>#519B default_db ignored TESTING /ant-object for <xsl:value-of select="document-uri(/)"/>"/> ;</xsl:message>
  518. <xsl:comment>#519B default_db ignored TESTING /ant-object test:
  519. <xsl:value-of select="ant-object:location__x3A__default_db.validate($default_db.ant-object.basedir,document-uri(/))"/>
  520. </xsl:comment>
  521. </xsl:when>
  522. <xsl:when test="contains(document-uri(/),$new-schema-with-ID-to-move-and-rename-to-xsd)">
  523. <xsl:message>#638 ignored /ant-object for <xsl:value-of select="document-uri(/)"/>;</xsl:message>
  524. </xsl:when>
  525. <xsl:when test="contains(document-uri(/),'Types/types.xsd')">
  526. <xsl:message>#564 ignored targetNamespace="http://biuro.biall-net.pl/p5/schema/types" for <xsl:value-of select="document-uri(/)"/>; - it is maintained by xsl file config fixed </xsl:message>
  527. </xsl:when>
  528. <xsl:when test="contains(document-uri(/),'dita-ot/') and contains(document-uri(/),'/plugins/' )">
  529. <xsl:message>#569 ignored contains(document-uri(/),'dita-ot/') and contains(document-uri(/),'/plugins/' ) for <xsl:value-of select="document-uri(/)"/>; - TODO MAINTAIN no targetnamespace </xsl:message>
  530. </xsl:when>
  531. <xsl:when test="contains(document-uri(/),'/dita_kosztorys_projektowy/') ">
  532. <xsl:message>#573 ignored contains(document-uri(/),'dita_kosztorys_projektowy') for <xsl:value-of select="document-uri(/)"/>; - TODO MAINTAIN no targetnamespace </xsl:message>
  533. </xsl:when>
  534. <xsl:when test=" contains(document-uri(/), concat($external_schema,'/'))">
  535. <xsl:comment>#145 Ignored /public_html/external_schema <xsl:value-of select="document-uri(/)"/></xsl:comment>
  536. <system_cache__appinfo:get_all_xsd_external_schema>
  537. <xsl:attribute name="system_cache__appinfo:document-uri" select="system_cache__appinfo:document-uri_for_external_schema_id_namespace_prefix(document-uri(/))"/>
  538. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="system_cache__appinfo:document-uri-full_for_external_schema_id_namespace_prefix(document-uri(/))"/>
  539. <xsl:attribute name="system_cache__appinfo:document-uri-orig" select="substring-after(document-uri(/), $external_schema)"/>
  540. <!--<xsl:attribute name="system_cache__appinfo:document-uri-full-orig" select="document-uri(/)"/>-->
  541. <!--<xsl:for-each select="//schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  542. <xsl:element name="{name()}">
  543. <xsl:for-each select="@*">
  544. <xsl:attribute name="{name()}" select="."/>
  545. <xsl:copy-of select="child::node()"/>
  546. </xsl:for-each>
  547. </xsl:element>
  548. </xsl:for-each>-->
  549. <!--<xsl:copy-of select="/"/>-->
  550. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema" select=".">
  551. <xsl:with-param name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  552. </xsl:apply-templates>
  553. </system_cache__appinfo:get_all_xsd_external_schema>
  554. </xsl:when>
  555. <xsl:when test=" contains(document-uri(/), concat($external_schema_id_namespace_prefix,'/'))">
  556. <xsl:comment>#248 Ignored /public_html/external_schema_id_namespace_prefix <xsl:value-of select="document-uri(/)"/></xsl:comment>
  557. <system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
  558. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  559. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  560. <xsl:attribute name="system_cache__appinfo:document-uri-orig" select="substring-after(document-uri(/), $external_schema_id_namespace_prefix)"/>
  561. <!--<xsl:for-each select="//schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  562. <xsl:element name="{name()}">
  563. <xsl:for-each select="@*">
  564. <xsl:attribute name="{name()}" select="."/>
  565. <xsl:copy-of select="child::node()"/>
  566. </xsl:for-each>
  567. </xsl:element>
  568. </xsl:for-each>-->
  569. <!--<xsl:copy-of select="/"/>-->
  570. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" select=".">
  571. <xsl:with-param name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $external_schema_id_namespace_prefix)"/>
  572. </xsl:apply-templates>
  573. </system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
  574. </xsl:when>
  575. <xsl:when test=" contains(document-uri(/), $default_db_xml_cache.public)">
  576. <xsl:comment>#619 NOT ignored schema by contains(document-uri(/), $default_db_xml_cache.public) == (<xsl:value-of select="$default_db_xml_cache.public"/>) (<xsl:value-of select="document-uri(/)"/>)</xsl:comment>
  577. <system_cache__appinfo:get_all_xsd.default_db_xml_cache.public>
  578. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $default_db_xml_cache.public)"/>
  579. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  580. <xsl:copy-of select="/"/>
  581. </system_cache__appinfo:get_all_xsd.default_db_xml_cache.public>
  582. </xsl:when>
  583. <!--<xsl:when test=" contains(document-uri(/), concat($default_db.dir,'/Types')) ">
  584. <xsl:comment>#662T NOT ignored schema by contains(document-uri(/), $default_db.dir/Types) == (<xsl:value-of select="$default_db.dir"/> + /Types) (<xsl:value-of select="document-uri(/)"/>)</xsl:comment>
  585. <system_cache__appinfo:get_all_xsd_default_db>
  586. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $default_db.dir)"/>
  587. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  588. <xsl:copy-of select="/"/>
  589. </system_cache__appinfo:get_all_xsd_default_db>
  590. </xsl:when>-->
  591. <xsl:when test=" contains(document-uri(/), concat($default_db.dir,'/')) ">
  592. <xsl:comment>#617A NOT ignored schema by contains(document-uri(/), $default_db.dir) == (<xsl:value-of select="$default_db.dir"/> + /) (<xsl:value-of select="document-uri(/)"/>)</xsl:comment>
  593. <system_cache__appinfo:get_all_xsd_default_db>
  594. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $default_db.dir)"/>
  595. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  596. <xsl:copy-of select="/"/>
  597. </system_cache__appinfo:get_all_xsd_default_db>
  598. </xsl:when>
  599. <xsl:when test=" contains(document-uri(/), $default_db.dir) and substring($default_db.dir, string-length($default_db.dir), 1) = '/' ">
  600. <xsl:comment>#617B NOT ignored schema by contains(document-uri(/), $default_db.dir) == (<xsl:value-of select="$default_db.dir"/>) (<xsl:value-of select="document-uri(/)"/>)</xsl:comment>
  601. <system_cache__appinfo:get_all_xsd_default_db>
  602. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $default_db.dir)"/>
  603. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  604. <xsl:copy-of select="/"/>
  605. </system_cache__appinfo:get_all_xsd_default_db>
  606. </xsl:when>
  607. <!--<xsl:when test=" contains(document-uri(/), $default_db.dir) ">
  608. <xsl:comment>#617C NOT ignored schema by contains(document-uri(/), $default_db.dir) == (<xsl:value-of select="$default_db.dir"/>) (<xsl:value-of select="document-uri(/)"/>)</xsl:comment>
  609. <xsl:comment>debug last (<xsl:value-of select="substring($default_db.dir, string-length($default_db.dir), 1)"/>)</xsl:comment>
  610. <system_cache__appinfo:get_all_xsd_default_db>
  611. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $default_db.dir)"/>
  612. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  613. <xsl:copy-of select="/"/>
  614. </system_cache__appinfo:get_all_xsd_default_db>
  615. </xsl:when>-->
  616. <xsl:when test=" contains(document-uri(/), $external_schema_table.path)">
  617. <system_cache__appinfo:get_all_xsd_external_schema_table>
  618. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $external_schema_table.path)"/>
  619. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  620. <xsl:copy-of select="/"/>
  621. </system_cache__appinfo:get_all_xsd_external_schema_table>
  622. </xsl:when>
  623. <xsl:when test=" contains(document-uri(/), $WPS_Functions)">
  624. <xsl:comment>#700 (!NOT) ignored schema by contains(document-uri(/), $WPS_Functions) (<xsl:value-of select="$WPS_Functions"/>)</xsl:comment>
  625. <xsl:message>#700 (!NOT) ignored schema by contains(document-uri(/), $WPS_Functions)</xsl:message>
  626. <!--<system_cache__appinfo:get_all_xsd>
  627. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $WPS_Functions)"/>
  628. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  629. <xsl:attribute name="WPS_Functions" select="$WPS_Functions"/>
  630. <xsl:copy-of select="/"/>
  631. </system_cache__appinfo:get_all_xsd>-->
  632. </xsl:when>
  633. <xsl:when test=" contains(document-uri(/), $procesy5_system_schema_collection_dir)">
  634. <xsl:comment>#701 (!NOT) ignored schema by contains(document-uri(/), $procesy5_system_schema_collection_dir) (<xsl:value-of select="document-uri(/)"/>) ($procesy5_system_schema_collection_dir=(<xsl:value-of select="$procesy5_system_schema_collection_dir"/>))</xsl:comment>
  635. <xsl:message>#701 (!NOT) ignored schema by contains(document-uri(/), $procesy5_system_schema_collection_dir) (<xsl:value-of select="document-uri(/)"/>) ($procesy5_system_schema_collection_dir=(<xsl:value-of select="$procesy5_system_schema_collection_dir"/>))</xsl:message>
  636. <!--<system_cache__appinfo:get_all_xsd>
  637. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $procesy5_system_schema_collection_dir)"/>
  638. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  639. <xsl:attribute name="WPS_Functions" select="$WPS_Functions"/>
  640. <xsl:copy-of select="/"/>
  641. </system_cache__appinfo:get_all_xsd>-->
  642. <xsl:comment> #701 test ant-object:location__x3A__default_db.validate = "<xsl:value-of select="ant-object:location__x3A__default_db.validate($default_db.ant-object.basedir,document-uri(/))"/>" </xsl:comment>
  643. </xsl:when>
  644. <xsl:otherwise>
  645. <xsl:comment>#641 Otherwise - try substring after /public_html from <xsl:value-of select="document-uri(/)"/></xsl:comment>
  646. <xsl:message>#641 Otherwise - try substring after /public_html from <xsl:value-of select="document-uri(/)"/></xsl:message>
  647. <system_cache__appinfo:get_all_xsd>
  648. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  649. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  650. <!--<xsl:for-each select="//schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  651. <xsl:element name="{name()}">
  652. <xsl:for-each select="@*">
  653. <xsl:attribute name="{name()}" select="."/>
  654. <xsl:copy-of select="child::node()"/>
  655. </xsl:for-each>
  656. </xsl:element>
  657. </xsl:for-each>-->
  658. <xsl:copy-of select="/"/>
  659. </system_cache__appinfo:get_all_xsd>
  660. </xsl:otherwise>
  661. </xsl:choose>
  662. </xsl:for-each>
  663. <!-- -->
  664. <xsl:message>#671 schemat dla XML primitives <xsl:value-of select="'http://www.w3.org/1999/XSL/Transform'"/></xsl:message>
  665. <xsl:comment>#671 schemat dla XML primitives <xsl:value-of select="'http://www.w3.org/1999/XSL/Transform'"/></xsl:comment>
  666. <system_cache__appinfo:get_all_xsd>
  667. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  668. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  669. <xsl:copy-of select="$system_cache__appinfo:primitives.xsd"/>
  670. </system_cache__appinfo:get_all_xsd>
  671. <xsl:message>#680 schemat dla XML primitives/derived <xsl:value-of select="'http://www.w3.org/1999/XSL/Transform'"/></xsl:message>
  672. <xsl:comment>#680 schemat dla XML primitives/derived <xsl:value-of select="'http://www.w3.org/1999/XSL/Transform'"/></xsl:comment>
  673. <system_cache__appinfo:get_all_xsd>
  674. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  675. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  676. <xsl:copy-of select="$system_cache__appinfo:derived.xsd"/>
  677. </system_cache__appinfo:get_all_xsd>
  678. <system_cache__appinfo:get_all_xsd>
  679. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  680. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  681. <xsl:copy-of select="$system_cache__appinfo:XMLSchema11.xsd"/>
  682. </system_cache__appinfo:get_all_xsd>
  683. <system_cache__appinfo:get_all_xsd>
  684. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  685. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  686. <xsl:copy-of select="$system_cache__appinfo:builtintypes.xsd"/>
  687. </system_cache__appinfo:get_all_xsd>
  688. <system_cache__appinfo:get_all_xsd>
  689. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
  690. <xsl:copy-of select="$system_cache__appinfo:p5Type.xsd//@system_cache__appinfo:document-uri"/>
  691. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
  692. <xsl:copy-of select="$system_cache__appinfo:p5Type.xsd"/>
  693. </system_cache__appinfo:get_all_xsd>
  694. <system_cache__appinfo:get_all_xsd>
  695. <xsl:attribute name="system_cache__appinfo:document-uri" select="'https://biuro.biall-net.pl/wfs'"/>
  696. <xsl:copy-of select="$system_cache__appinfo:p5.xsd//@system_cache__appinfo:document-uri"/>
  697. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'https://biuro.biall-net.pl/wfs'"/>
  698. <xsl:copy-of select="$system_cache__appinfo:p5.xsd"/>
  699. </system_cache__appinfo:get_all_xsd>
  700. <system_cache__appinfo:get_all_xsd>
  701. <xsl:copy-of select="$system_cache__appinfo:SVG.xsd//@system_cache__appinfo:document-uri"/>
  702. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="$system_cache__appinfo:SVG.xsd//@targetNamespace"/>
  703. <xsl:copy-of select="$system_cache__appinfo:SVG.xsd"/>
  704. </system_cache__appinfo:get_all_xsd>
  705. <system_cache__appinfo:get_all_xsd>
  706. <xsl:copy-of select="$system_cache__appinfo:xlink.xsd//@system_cache__appinfo:document-uri"/>
  707. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="$system_cache__appinfo:xlink.xsd//@targetNamespace"/>
  708. <xsl:copy-of select="$system_cache__appinfo:xlink.xsd"/>
  709. </system_cache__appinfo:get_all_xsd>
  710. <system_cache__appinfo:get_all_xsd>
  711. <xsl:copy-of select="$system_cache__appinfo:xml.xsd//@system_cache__appinfo:document-uri"/>
  712. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="$system_cache__appinfo:xml.xsd//@targetNamespace"/>
  713. <xsl:copy-of select="$system_cache__appinfo:xml.xsd"/>
  714. </system_cache__appinfo:get_all_xsd>
  715. </system_cache__appinfo:get_all_xsd_list>
  716. </xsl:variable>
  717. <!--<xsl:result-document href="{concat('../default_db.instance.xml/transformed/',$element-filename,'.xml')}">
  718. <xsl:copy-of select="$procesy5_system_schema"/>
  719. </xsl:result-document>-->
  720. <xsl:copy-of select="$procesy5_system_schema"/>
  721. </xsl:otherwise>
  722. </xsl:choose>
  723. </xsl:template>
  724. <!--TODO DISABLED TEMPORARY - IF IS USED? <xsl:template name="system_cache__appinfo:vrtfNamespaces"><!-\- consider namespaces for get_all_xsd_external_schema -\->
  725. <xsl:variable name="procesy5_system_schema">
  726. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  727. <xsl:with-param name="path2collection" select="$procesy5_system_schema_collection_dir"/>
  728. <xsl:with-param name="cache" select="'read'"/>
  729. </xsl:call-template>
  730. </xsl:variable>
  731. <system_cache__appinfo:vrtfNamespaces>
  732. <xsl:for-each select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/system_cache__appinfo:get_all_xsd/schema/namespace::node()"
  733. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  734. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  735. </xsl:for-each>
  736. </system_cache__appinfo:vrtfNamespaces>
  737. </xsl:template>-->
  738. <!--<xsl:template name="system_cache__appinfo:vrtfNamespaces_external_schema">
  739. <xsl:variable name="procesy5_system_schema">
  740. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  741. <xsl:with-param name="path2collection" select="$procesy5_system_schema_collection_dir"/>
  742. <xsl:with-param name="cache" select="'read'"/>
  743. </xsl:call-template>
  744. </xsl:variable>
  745. <system_cache__appinfo:vrtfNamespaces_external_schema>
  746. <xsl:for-each select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/system_cache__appinfo:get_all_xsd_external_schema/schema/namespace::node()"
  747. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  748. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  749. </xsl:for-each>
  750. </system_cache__appinfo:vrtfNamespaces_external_schema>
  751. </xsl:template>-->
  752. <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:vrtfNamespaces">
  753. <system_cache__appinfo:vrtfNamespaces>
  754. <xsl:for-each select="//(system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix|system_cache__appinfo:get_all_xsd_default_db)/schema/namespace::node()"
  755. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  756. <ns element="{name(..)}" prefix="{name()}" uri="{.}" debug="l.849"
  757. system_cache__appinfo:document-uri="{../../@system_cache__appinfo:document-uri}"/>
  758. </xsl:for-each>
  759. <xsl:for-each select="//system_cache__appinfo:get_all_xsd_default_db/schema"
  760. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  761. <xsl:variable name="targetNamespace" select="@targetNamespace"/>
  762. <xsl:choose>
  763. <xsl:when test="namespace::node()=$targetNamespace">
  764. <xsl:message>#701-A OK $targetNamespace <xsl:value-of select="$targetNamespace"/> has declared prefix </xsl:message>
  765. </xsl:when>
  766. <xsl:otherwise>
  767. <xsl:message>#701-B WARNING we should crete prefix ($zasob_id_db_targetNamespace_detect_string=<xsl:value-of select="$zasob_id_db_targetNamespace_detect_string"/>) for $targetNamespace <xsl:value-of select="$targetNamespace"/> = <xsl:value-of select="system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($targetNamespace)"/> </xsl:message>
  768. <ns element="{name(.)}"
  769. debug="l.862"
  770. prefix="{system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($targetNamespace)}"
  771. uri="{$targetNamespace}"
  772. system_cache__appinfo:document-uri="{../@system_cache__appinfo:document-uri}"/>
  773. </xsl:otherwise>
  774. </xsl:choose>
  775. </xsl:for-each>
  776. </system_cache__appinfo:vrtfNamespaces>
  777. </xsl:template>
  778. <!--<xsl:function name="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename">
  779. <xsl:param name="template_context"/><!-\- system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_complexType , system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_element -\->
  780. <xsl:param name="parent_type"/>
  781. <xsl:choose>
  782. <xsl:when test="$template_context='system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_element'">
  783. <xsl:value-of select="concat($default_db.instance.xml,'/detect_resource_type/element-',system_cache__appinfo:escape_object_prefix_to_string($parent_type),'.xml')"/>
  784. </xsl:when>
  785. <xsl:when test="$template_context='system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_complexType'">
  786. <xsl:value-of select="concat($default_db.instance.xml,'/detect_resource_type/complexType-',system_cache__appinfo:escape_object_prefix_to_string($parent_type),'.xml')"/>
  787. </xsl:when>
  788. <xsl:otherwise><xsl:message terminate="yes">#767 unknown type $template_context=<xsl:value-of select="$template_context"/></xsl:message></xsl:otherwise>
  789. </xsl:choose>
  790. </xsl:function>
  791. -->
  792. <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:element_complexType">
  793. <xsl:param name="targetNamespace" select="$targetNamespace_DEFAULTS"/>
  794. <system_cache__appinfo:element_complexType xsl:use-attribute-sets="p5ant-interface:xslt.param.get_all_xsd_list">
  795. <xsl:attribute name="default_db.dir" select="$default_db.dir"/>
  796. <xsl:attribute name="WPS_Functions" select="$WPS_Functions"/>
  797. <xsl:attribute name="default_db_xml_cache.public" select="$default_db_xml_cache.public"/>
  798. <xsl:attribute name="external_schema" select="$external_schema"/>
  799. <xsl:attribute name="p5Type.basedir" select="$p5Type.basedir"/>
  800. <xsl:comment>#909 simpleType</xsl:comment>
  801. <xsl:apply-templates mode="#current">
  802. <xsl:with-param name="system_cache__appinfo:element_complexType.requested" select="'simpleType'" tunnel="yes"/>
  803. </xsl:apply-templates>
  804. <xsl:comment>#913 complexType</xsl:comment>
  805. <xsl:apply-templates mode="#current">
  806. <xsl:with-param name="system_cache__appinfo:element_complexType.requested" select="'complexType'" tunnel="yes"/>
  807. </xsl:apply-templates>
  808. <xsl:comment>#917 element</xsl:comment>
  809. <xsl:apply-templates mode="#current">
  810. <xsl:with-param name="system_cache__appinfo:element_complexType.requested" select="'element'" tunnel="yes"/>
  811. </xsl:apply-templates>
  812. </system_cache__appinfo:element_complexType>
  813. </xsl:template>
  814. <xsl:template match="system_cache__appinfo:get_all_xsd[ substring-before(@system_cache__appinfo:document-uri,'/')!='default_db_xml_cache' and substring-before(@system_cache__appinfo:document-uri,'/')!='default_db_xml_cache.public']" mode="system_cache__appinfo:element_complexType">
  815. <xsl:param name="system_cache__appinfo:element_complexType.requested" required="yes" tunnel="yes"/>
  816. <xsl:apply-templates mode="#current"/>
  817. </xsl:template>
  818. <xsl:template match="system_cache__appinfo:get_all_xsd" mode="system_cache__appinfo:element_complexType">
  819. <xsl:comment>#927 filtered default bypassed <xsl:value-of select="@system_cache__appinfo:document-uri"/></xsl:comment>
  820. </xsl:template>
  821. <xsl:template match="schema" mode="system_cache__appinfo:element_complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  822. <xsl:param name="system_cache__appinfo:element_complexType.requested" required="yes" tunnel="yes"/>
  823. <!-- <xsl:sort select="max( */*/count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>-->
  824. <xsl:variable name="get_all_xsd_236" select="."/>
  825. <!--<xsl:comment>
  826. max1="<xsl:value-of select="max( count(*/*/descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))"/>"
  827. max1=2<xsl:value-of select="max( */*/count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))"/>"
  828. 246:detect_resource_type, przetwarzam schemat:<xsl:value-of select="@system_cache__appinfo:document-uri"/>; $targetNamespace:<xsl:value-of select="$targetNamespace"/>;
  829. @targetNamespace:<xsl:value-of select="schema/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>;</xsl:comment>-->
  830. <xsl:variable name="schema_node_144" select="parent::*"/>
  831. <!--<xsl:for-each select="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">--><!--[ @targetNamespace != $targetNamespace ] namespace::node() = $targetNamespace and @targetNamespace='moj_ogrodek' -->
  832. <!--<xsl:sort select="max( */count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))+" order="ascending" data-type="number"/>-->
  833. <xsl:message>#239::detect_resource_type przetwarzam schemat:@targetNamespace:<xsl:value-of select="@targetNamespace"/>;</xsl:message>
  834. <!--<xsl:variable name="prefix_83" select="namespace::node()[. = $targetNamespace]/name()"/>-->
  835. <xsl:variable name="targetNamespace_134" select="@targetNamespace"/>
  836. <!--<xsl:variable name="prefix_134" select="namespace::node()[. = $targetNamespace_134][1]/name()"/>--><!-- np. test_objects -->
  837. <xsl:variable name="prefix_134">
  838. <xsl:choose>
  839. <xsl:when test="string-length(namespace::node()[. = $targetNamespace_134][1]/name()) &gt; 0">
  840. <xsl:value-of select="namespace::node()[. = $targetNamespace_134][1]/name()"/>
  841. <xsl:message>#784-A TODO test=<xsl:value-of select="namespace::node()[. = $targetNamespace_134][1]/name()"/>;</xsl:message>
  842. </xsl:when>
  843. <xsl:when test="$schema_node_144/@WPS_Functions">
  844. <xsl:message>#784-B TODO ERROR - FORCING PREFIX TO <xsl:value-of select="tokenize($schema_node_144/@system_cache__appinfo:document-uri,'/')[ position() = last()]"/></xsl:message>
  845. <xsl:value-of select="tokenize(../@system_cache__appinfo:document-uri,'/')[ position() = last()]"/>
  846. </xsl:when>
  847. <xsl:when test="contains(../@system_cache__appinfo:document-uri-full,$p5Type.basedir)">
  848. <xsl:message>#784-C TODO TYPES WARNING - FORCING PREFIX TO <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(@targetNamespace)"/></xsl:message>
  849. <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(@targetNamespace)"/>
  850. </xsl:when>
  851. </xsl:choose>
  852. </xsl:variable>
  853. <xsl:if test="not(@targetNamespace) or not( string-length($prefix_134) &gt; 0) ">
  854. <xsl:message terminate="yes">#394 ERROR - schema error - set @targetNamespace and prefix for shema file:<xsl:value-of select="../@system_cache__appinfo:document-uri-full"/> ; ($prefix_134=<xsl:value-of select="$prefix_134"/>)</xsl:message>
  855. </xsl:if>
  856. <xsl:choose>
  857. <xsl:when test="not($system_cache__appinfo:element_complexType.requested='element')"/>
  858. <xsl:when test="@targetNamespace='http://www.w3.org/2001/XMLSchema'"/>
  859. <xsl:when test="@targetNamespace='http://biuro.biall-net.pl/p5/schema/types'"/>
  860. <xsl:when test="contains(@system_cache__appinfo:document-uri-full,'http://')"/>
  861. <xsl:when test="contains(@system_cache__appinfo:document-uri-full,'https://')"/>
  862. <xsl:otherwise>
  863. <xsl:element name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external.get_all_xsd">
  864. <xsl:copy-of select="@*"/>
  865. <xsl:copy-of select=".././@*"/>
  866. </xsl:element>
  867. </xsl:otherwise>
  868. </xsl:choose>
  869. <!--</xsl:for-each>-->
  870. <xsl:if test="count(.//node()[(local-name()='element' or local-name()='simpleType' or local-name()='complexType' or local-name()='sequence' or local-name()='choice' or local-name()='complexContent' or local-name()='extension' ) and not(@id)])=0">
  871. <xsl:for-each select="*[local-name()=$system_cache__appinfo:element_complexType.requested]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!-- dla ograniczenia mozna [$prefix_134='test_objects']-->
  872. <xsl:sort select="max( count(descendant-or-self::*[@ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
  873. <xsl:variable name="complexType_or_element_name186">
  874. <xsl:choose>
  875. <xsl:when test="local-name()='element'"><xsl:value-of select="@name"/></xsl:when>
  876. <xsl:when test="local-name()='complexType'"><xsl:value-of select="@name"/></xsl:when>
  877. <xsl:when test="local-name()='simpleType'"><xsl:value-of select="@name"/></xsl:when>
  878. <xsl:otherwise><xsl:message terminate="yes">#391 it should work only for element or complexType</xsl:message></xsl:otherwise>
  879. </xsl:choose>
  880. </xsl:variable>
  881. <xsl:comment>157: count(descendant-or-self::*)="<xsl:value-of select="count(descendant-or-self::*)"/>"
  882. count2(descendant-or-self::*)="<xsl:value-of select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>"
  883. buduje plaski obiekt/mape przetwarzania w celu przeszukania relacji @id=<xsl:value-of select="@id"/>; targetNamespace:<xsl:value-of select="$prefix_134"/>;
  884. $complexType_or_element_name186=<xsl:value-of select="$complexType_or_element_name186"/>; name:<xsl:value-of select="@name"/>; namespace-uri-for-prefix=<xsl:value-of select="namespace-uri-for-prefix($prefix_134,.)"/></xsl:comment>
  885. <xsl:message>157: buduje plaski obiekt/mape przetwarzania w celu przeszukania relacji @id=<xsl:value-of select="@id"/>; targetNamespace:<xsl:value-of select="$prefix_134"/>; $complexType_or_element_name186=<xsl:value-of select="$complexType_or_element_name186"/>; name:<xsl:value-of select="@name"/>; namespace-uri-for-prefix=<xsl:value-of select="namespace-uri-for-prefix($prefix_134,.)"/></xsl:message>
  886. <xsl:choose>
  887. <xsl:when test="local-name()='element'">
  888. <build_cache name="build_element" >
  889. <xsl:attribute name="id" select="@id"/>
  890. <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
  891. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  892. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  893. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  894. <xsl:attribute name="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename" select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  895. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  896. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  897. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  898. <xsl:copy-of select="@system_cache__appinfo:path.2863.len.limit"/>
  899. <!--<xsl:attribute name="system_cache__appinfo:element-filename" select="system_cache__appinfo:element-filename()"/>-->
  900. <with-param name="element" select="{$prefix_134}:{$complexType_or_element_name186}"/>
  901. <system_cache__appinfo:element-filename><xsl:value-of select="system_cache__appinfo:element-filename('build_element',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename>
  902. <system_cache__appinfo:element-filename-prefixed><xsl:value-of select="system_cache__appinfo:element-filename-prefixed('build_element',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename-prefixed>
  903. <p5_tr_map:element-filename><xsl:value-of select="p5_tr_map:element-filename('go_recurse_from_root_by_build_element_cache',concat($prefix_134,':',$complexType_or_element_name186))"/></p5_tr_map:element-filename>
  904. <p5_tr_map:element-filename-prefixed><xsl:value-of select="p5_tr_map:element-filename-prefixed(concat($prefix_134,':',$complexType_or_element_name186))"/></p5_tr_map:element-filename-prefixed>
  905. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  906. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  907. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  908. <p5_simpleSchema_map:element-filename><xsl:value-of select="p5_simpleSchema_map:element-filename(concat($prefix_134,':',$complexType_or_element_name186),.././@targetNamespace)"/></p5_simpleSchema_map:element-filename>
  909. <!--<system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename><xsl:value-of select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename('system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_element',concat($prefix_134,':',$complexType_or_element_name186))"/></system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename>-->
  910. </build_cache>
  911. </xsl:when>
  912. <xsl:when test="local-name()='complexType'">
  913. <build_cache name="build_complexType" >
  914. <xsl:attribute name="id" select="@id"/>
  915. <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
  916. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  917. <!--<xsl:message>#808.1.DEBUG ok</xsl:message>-->
  918. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  919. <!--<xsl:message>#808.2.DEBUG ok</xsl:message>-->
  920. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  921. <!--<xsl:message>#808.3.DEBUG ok</xsl:message>-->
  922. <xsl:attribute name="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename" select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  923. <!--<xsl:message>#808.4.DEBUG ok</xsl:message>-->
  924. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  925. <!--<xsl:message>#808.5.DEBUG ok</xsl:message>-->
  926. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  927. <!--<xsl:message>#808.6.DEBUG ok</xsl:message>-->
  928. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  929. <xsl:copy-of select="@system_cache__appinfo:path.2863.len.limit"/>
  930. <with-param name="complexType"
  931. select="{$prefix_134}:{$complexType_or_element_name186}"/>
  932. <!--<xsl:message>#808.7.DEBUG ok</xsl:message>-->
  933. <system_cache__appinfo:element-filename><xsl:value-of select="system_cache__appinfo:element-filename('build_complexType',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename>
  934. <!--<system_cache__appinfo:element-filename-prefixed><xsl:value-of select="system_cache__appinfo:element-filename-prefixed('build_complexType',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename-prefixed>-->
  935. <!--<xsl:message>#808.8.DEBUG ok</xsl:message>-->
  936. <p5_tr_map:element-filename><xsl:value-of select="p5_tr_map:element-filename('go_recurse_from_root_by_build_complexType_cache',concat($prefix_134,':',$complexType_or_element_name186))"/></p5_tr_map:element-filename>
  937. <!--<xsl:message>#808.9.DEBUG ok</xsl:message>-->
  938. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  939. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  940. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  941. <!--<system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename><xsl:value-of select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename('system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_complexType',concat($prefix_134,':',$complexType_or_element_name186))"/></system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename>-->
  942. </build_cache>
  943. </xsl:when>
  944. <xsl:when test="local-name()='simpleType'">
  945. <build_cache name="build_complexType__simpleType" >
  946. <xsl:attribute name="id" select="@id"/>
  947. <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
  948. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  949. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  950. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  951. <xsl:attribute name="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename" select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  952. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  953. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  954. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  955. <xsl:attribute name="debug.targetNamespace" select="parent::*/@targetNamespace "/>
  956. <!--<xsl:attribute name="debug.prefix" select="parent::*/namespace::*[ . = @targetNamespace ]/name()"/>-->
  957. <xsl:attribute name="debug.prefix" select="parent::*/namespace::*[ . = ../@targetNamespace ]/name()"/>
  958. <xsl:attribute name="debug.prefix2" select="parent::*/namespace::*[ . = ../@targetNamespace and not(name()='') ]/name()"/>
  959. <xsl:copy-of select="@system_cache__appinfo:path.2863.len.limit"/>
  960. <!--<xsl:attribute name="system_cache__appinfo:element-filename" select="system_cache__appinfo:element-filename()"/>-->
  961. <!--<with-param name="element" select="{$prefix_134}:{$complexType_or_element_name186}"/>-->
  962. <xsl:choose>
  963. <xsl:when test="not(parent::*/namespace::*[ . = ../@targetNamespace and not(name()='') ])">
  964. <xsl:message terminate="yes">#952 ERROR WITH @targetNamespace="<xsl:value-of select="parent::*/@targetNamespace "/>"; @system_cache__appinfo:document-uri-full="<xsl:value-of select="../.././@system_cache__appinfo:document-uri-full"/>" </xsl:message>
  965. </xsl:when>
  966. </xsl:choose>
  967. <with-param name="element" select="{parent::*/namespace::*[ . = ../@targetNamespace and not(name()='')]/name()}:{$complexType_or_element_name186}"/>
  968. <system_cache__appinfo:element-filename><xsl:value-of select="system_cache__appinfo:element-filename('build_complexType__simpleType',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename>
  969. <system_cache__appinfo:element-filename-prefixed><xsl:value-of select="system_cache__appinfo:element-filename-prefixed('build_complexType__simpleType',@name,$prefix_134,$targetNamespace_134)"/></system_cache__appinfo:element-filename-prefixed>
  970. <p5_tr_map:element-filename><xsl:value-of select="p5_tr_map:element-filename('go_recurse_from_root_by_build_element_cache',concat($prefix_134,':',$complexType_or_element_name186))"/></p5_tr_map:element-filename>
  971. <p5_tr_map:element-filename-prefixed><xsl:value-of select="p5_tr_map:element-filename-prefixed(concat($prefix_134,':',$complexType_or_element_name186))"/></p5_tr_map:element-filename-prefixed>
  972. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  973. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  974. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  975. <p5_simpleSchema_map:element-filename><xsl:value-of select="p5_simpleSchema_map:element-filename(concat($prefix_134,':',$complexType_or_element_name186),.././@targetNamespace)"/></p5_simpleSchema_map:element-filename>
  976. <!--<system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename><xsl:value-of select="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename('system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_element',concat($prefix_134,':',$complexType_or_element_name186))"/></system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename>-->
  977. </build_cache>
  978. </xsl:when>
  979. </xsl:choose>
  980. </xsl:for-each>
  981. </xsl:if>
  982. </xsl:template>
  983. <!-- do aktualizowania pozycji w schemache-->
  984. <xsl:template name="system_cache__appinfo:position">
  985. <xsl:param name="xml"/>
  986. <xsl:for-each select="$xml/*">
  987. <xsl:if test="name()">
  988. <xsl:element name="{name()}">
  989. <xsl:attribute name="system_cache__appinfo:position" select="position()"/>
  990. <xsl:apply-templates mode="system_cache__appinfo:position" select="@*"/>
  991. <xsl:call-template name="system_cache__appinfo:position">
  992. <xsl:with-param name="xml" select="."/>
  993. </xsl:call-template>
  994. </xsl:element>
  995. </xsl:if>
  996. </xsl:for-each>
  997. </xsl:template>
  998. <xsl:template match="@*" mode="system_cache__appinfo:position">
  999. <xsl:attribute name="{name()}" select="."/>
  1000. </xsl:template>
  1001. <xsl:template match="text()" mode="system_cache__appinfo:position"/>
  1002. <xsl:template match="comment()" mode="system_cache__appinfo:position"/>
  1003. </xsl:stylesheet>