get_all_xsd.xsl 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068
  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_list>
  701. </xsl:variable>
  702. <!--<xsl:result-document href="{concat('../default_db.instance.xml/transformed/',$element-filename,'.xml')}">
  703. <xsl:copy-of select="$procesy5_system_schema"/>
  704. </xsl:result-document>-->
  705. <xsl:copy-of select="$procesy5_system_schema"/>
  706. </xsl:otherwise>
  707. </xsl:choose>
  708. </xsl:template>
  709. <!--TODO DISABLED TEMPORARY - IF IS USED? <xsl:template name="system_cache__appinfo:vrtfNamespaces"><!-\- consider namespaces for get_all_xsd_external_schema -\->
  710. <xsl:variable name="procesy5_system_schema">
  711. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  712. <xsl:with-param name="path2collection" select="$procesy5_system_schema_collection_dir"/>
  713. <xsl:with-param name="cache" select="'read'"/>
  714. </xsl:call-template>
  715. </xsl:variable>
  716. <system_cache__appinfo:vrtfNamespaces>
  717. <xsl:for-each select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/system_cache__appinfo:get_all_xsd/schema/namespace::node()"
  718. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  719. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  720. </xsl:for-each>
  721. </system_cache__appinfo:vrtfNamespaces>
  722. </xsl:template>-->
  723. <!--<xsl:template name="system_cache__appinfo:vrtfNamespaces_external_schema">
  724. <xsl:variable name="procesy5_system_schema">
  725. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  726. <xsl:with-param name="path2collection" select="$procesy5_system_schema_collection_dir"/>
  727. <xsl:with-param name="cache" select="'read'"/>
  728. </xsl:call-template>
  729. </xsl:variable>
  730. <system_cache__appinfo:vrtfNamespaces_external_schema>
  731. <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()"
  732. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  733. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  734. </xsl:for-each>
  735. </system_cache__appinfo:vrtfNamespaces_external_schema>
  736. </xsl:template>-->
  737. <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:vrtfNamespaces">
  738. <system_cache__appinfo:vrtfNamespaces>
  739. <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()"
  740. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  741. <ns element="{name(..)}" prefix="{name()}" uri="{.}" system_cache__appinfo:document-uri="{../../@system_cache__appinfo:document-uri}"/>
  742. </xsl:for-each>
  743. <xsl:for-each select="//system_cache__appinfo:get_all_xsd_default_db/schema"
  744. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  745. <xsl:variable name="targetNamespace" select="@targetNamespace"/>
  746. <xsl:choose>
  747. <xsl:when test="namespace::node()=$targetNamespace">
  748. <xsl:message>#701-A OK $targetNamespace <xsl:value-of select="$targetNamespace"/> has declared prefix </xsl:message>
  749. </xsl:when>
  750. <xsl:otherwise>
  751. <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>
  752. <ns element="{name(.)}" prefix="{system_cache__appinfo:object_install_se_ant_object.detect_external_targetNamespace($targetNamespace)}" uri="{$targetNamespace}" system_cache__appinfo:document-uri="{../@system_cache__appinfo:document-uri}"/>
  753. </xsl:otherwise>
  754. </xsl:choose>
  755. </xsl:for-each>
  756. </system_cache__appinfo:vrtfNamespaces>
  757. </xsl:template>
  758. <!--<xsl:function name="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename">
  759. <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 -\->
  760. <xsl:param name="parent_type"/>
  761. <xsl:choose>
  762. <xsl:when test="$template_context='system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_element'">
  763. <xsl:value-of select="concat($default_db.instance.xml,'/detect_resource_type/element-',system_cache__appinfo:escape_object_prefix_to_string($parent_type),'.xml')"/>
  764. </xsl:when>
  765. <xsl:when test="$template_context='system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_complexType'">
  766. <xsl:value-of select="concat($default_db.instance.xml,'/detect_resource_type/complexType-',system_cache__appinfo:escape_object_prefix_to_string($parent_type),'.xml')"/>
  767. </xsl:when>
  768. <xsl:otherwise><xsl:message terminate="yes">#767 unknown type $template_context=<xsl:value-of select="$template_context"/></xsl:message></xsl:otherwise>
  769. </xsl:choose>
  770. </xsl:function>
  771. -->
  772. <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:element_complexType">
  773. <xsl:param name="targetNamespace" select="$targetNamespace_DEFAULTS"/>
  774. <system_cache__appinfo:element_complexType xsl:use-attribute-sets="p5ant-interface:xslt.param.get_all_xsd_list">
  775. <xsl:attribute name="default_db.dir" select="$default_db.dir"/>
  776. <xsl:attribute name="WPS_Functions" select="$WPS_Functions"/>
  777. <xsl:attribute name="default_db_xml_cache.public" select="$default_db_xml_cache.public"/>
  778. <xsl:attribute name="external_schema" select="$external_schema"/>
  779. <xsl:attribute name="p5Type.basedir" select="$p5Type.basedir"/>
  780. <xsl:for-each select="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']" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
  781. <xsl:sort select="max( */*/count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
  782. <xsl:variable name="get_all_xsd_236" select="."/>
  783. <xsl:comment>
  784. max1="<xsl:value-of select="max( count(*/*/descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))"/>"
  785. max1=2<xsl:value-of select="max( */*/count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))"/>"
  786. 246:detect_resource_type, przetwarzam schemat:<xsl:value-of select="@system_cache__appinfo:document-uri"/>; $targetNamespace:<xsl:value-of select="$targetNamespace"/>;
  787. @targetNamespace:<xsl:value-of select="schema/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>;</xsl:comment>
  788. <xsl:variable name="schema_node_144" select="."/>
  789. <xsl:for-each select="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!--[ @targetNamespace != $targetNamespace ] namespace::node() = $targetNamespace and @targetNamespace='moj_ogrodek' -->
  790. <xsl:sort select="max( */count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
  791. <xsl:message>#239::detect_resource_type przetwarzam schemat:@targetNamespace:<xsl:value-of select="@targetNamespace"/>;</xsl:message>
  792. <xsl:variable name="prefix_83" select="namespace::node()[. = $targetNamespace]/name()"/>
  793. <xsl:variable name="targetNamespace_134" select="@targetNamespace"/>
  794. <!--<xsl:variable name="prefix_134" select="namespace::node()[. = $targetNamespace_134][1]/name()"/>--><!-- np. test_objects -->
  795. <xsl:variable name="prefix_134">
  796. <xsl:choose>
  797. <xsl:when test="string-length(namespace::node()[. = $targetNamespace_134][1]/name()) &gt; 0">
  798. <xsl:value-of select="namespace::node()[. = $targetNamespace_134][1]/name()"/>
  799. <xsl:message>#784-A TODO test=<xsl:value-of select="namespace::node()[. = $targetNamespace_134][1]/name()"/>;</xsl:message>
  800. </xsl:when>
  801. <xsl:when test="$schema_node_144/@WPS_Functions">
  802. <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>
  803. <xsl:value-of select="tokenize(../@system_cache__appinfo:document-uri,'/')[ position() = last()]"/>
  804. </xsl:when>
  805. <xsl:when test="contains(../@system_cache__appinfo:document-uri-full,$p5Type.basedir)">
  806. <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>
  807. <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(@targetNamespace)"/>
  808. </xsl:when>
  809. </xsl:choose>
  810. </xsl:variable>
  811. <xsl:if test="not(@targetNamespace) or not( string-length($prefix_134) &gt; 0) ">
  812. <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>
  813. </xsl:if>
  814. <xsl:choose>
  815. <xsl:when test="@targetNamespace='http://www.w3.org/2001/XMLSchema'"/>
  816. <xsl:when test="@targetNamespace='http://biuro.biall-net.pl/p5/schema/types'"/>
  817. <xsl:when test="contains(@system_cache__appinfo:document-uri-full,'http://')"/>
  818. <xsl:when test="contains(@system_cache__appinfo:document-uri-full,'https://')"/>
  819. <xsl:otherwise>
  820. <xsl:element name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external.get_all_xsd">
  821. <xsl:copy-of select="@*"/>
  822. <xsl:copy-of select=".././@*"/>
  823. </xsl:element>
  824. </xsl:otherwise>
  825. </xsl:choose>
  826. <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">
  827. <xsl:for-each select="(element|complexType|simpleType)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!-- dla ograniczenia mozna [$prefix_134='test_objects']-->
  828. <xsl:sort select="max( count(descendant-or-self::*[@ref or not(contains(@type,'xs:')) ]))" order="ascending" data-type="number"/>
  829. <xsl:variable name="complexType_or_element_name186">
  830. <xsl:choose>
  831. <xsl:when test="local-name()='element'"><xsl:value-of select="@name"/></xsl:when>
  832. <xsl:when test="local-name()='complexType'"><xsl:value-of select="@name"/></xsl:when>
  833. <xsl:when test="local-name()='simpleType'"><xsl:value-of select="@name"/></xsl:when>
  834. <xsl:otherwise><xsl:message terminate="yes">#391 it should work only for element or complexType</xsl:message></xsl:otherwise>
  835. </xsl:choose>
  836. </xsl:variable>
  837. <xsl:comment>157: count(descendant-or-self::*)="<xsl:value-of select="count(descendant-or-self::*)"/>"
  838. count2(descendant-or-self::*)="<xsl:value-of select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>"
  839. buduje plaski obiekt/mape przetwarzania w celu przeszukania relacji @id=<xsl:value-of select="@id"/>; targetNamespace:<xsl:value-of select="$prefix_134"/>;
  840. $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>
  841. <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>
  842. <xsl:choose>
  843. <xsl:when test="local-name()='element'">
  844. <build_cache name="build_element" >
  845. <xsl:attribute name="id" select="@id"/>
  846. <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
  847. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  848. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  849. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  850. <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)"/>
  851. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  852. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  853. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  854. <!--<xsl:attribute name="system_cache__appinfo:element-filename" select="system_cache__appinfo:element-filename()"/>-->
  855. <with-param name="element" select="{$prefix_134}:{$complexType_or_element_name186}"/>
  856. <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>
  857. <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>
  858. <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>
  859. <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>
  860. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  861. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  862. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  863. <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>
  864. <!--<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>-->
  865. </build_cache>
  866. </xsl:when>
  867. <xsl:when test="local-name()='complexType'">
  868. <build_cache name="build_complexType" >
  869. <xsl:attribute name="id" select="@id"/>
  870. <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
  871. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  872. <!--<xsl:message>#808.1.DEBUG ok</xsl:message>-->
  873. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  874. <!--<xsl:message>#808.2.DEBUG ok</xsl:message>-->
  875. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  876. <!--<xsl:message>#808.3.DEBUG ok</xsl:message>-->
  877. <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)"/>
  878. <!--<xsl:message>#808.4.DEBUG ok</xsl:message>-->
  879. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  880. <!--<xsl:message>#808.5.DEBUG ok</xsl:message>-->
  881. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  882. <!--<xsl:message>#808.6.DEBUG ok</xsl:message>-->
  883. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  884. <with-param name="complexType"
  885. select="{$prefix_134}:{$complexType_or_element_name186}"/>
  886. <!--<xsl:message>#808.7.DEBUG ok</xsl:message>-->
  887. <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>
  888. <!--<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>-->
  889. <!--<xsl:message>#808.8.DEBUG ok</xsl:message>-->
  890. <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>
  891. <!--<xsl:message>#808.9.DEBUG ok</xsl:message>-->
  892. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  893. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  894. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  895. <!--<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>-->
  896. </build_cache>
  897. </xsl:when>
  898. <xsl:when test="local-name()='simpleType'">
  899. <build_cache name="build_complexType__simpleType" >
  900. <xsl:attribute name="id" select="@id"/>
  901. <xsl:attribute name="count" select="count(descendant-or-self::*[ @ref or not(contains(@type,'xs:')) ])"/>
  902. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  903. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  904. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  905. <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)"/>
  906. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  907. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  908. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  909. <xsl:attribute name="debug.targetNamespace" select="parent::*/@targetNamespace "/>
  910. <!--<xsl:attribute name="debug.prefix" select="parent::*/namespace::*[ . = @targetNamespace ]/name()"/>-->
  911. <xsl:attribute name="debug.prefix" select="parent::*/namespace::*[ . = ../@targetNamespace ]/name()"/>
  912. <xsl:attribute name="debug.prefix2" select="parent::*/namespace::*[ . = ../@targetNamespace and not(name()='') ]/name()"/>
  913. <!--<xsl:attribute name="system_cache__appinfo:element-filename" select="system_cache__appinfo:element-filename()"/>-->
  914. <!--<with-param name="element" select="{$prefix_134}:{$complexType_or_element_name186}"/>-->
  915. <xsl:choose>
  916. <xsl:when test="not(parent::*/namespace::*[ . = ../@targetNamespace and not(name()='') ])">
  917. <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>
  918. </xsl:when>
  919. </xsl:choose>
  920. <with-param name="element" select="{parent::*/namespace::*[ . = ../@targetNamespace and not(name()='')]/name()}:{$complexType_or_element_name186}"/>
  921. <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>
  922. <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>
  923. <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>
  924. <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>
  925. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  926. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  927. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  928. <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>
  929. <!--<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>-->
  930. </build_cache>
  931. </xsl:when>
  932. </xsl:choose>
  933. </xsl:for-each>
  934. </xsl:if>
  935. </xsl:for-each>
  936. </xsl:for-each>
  937. </system_cache__appinfo:element_complexType>
  938. </xsl:template>
  939. <!-- do aktualizowania pozycji w schemache-->
  940. <xsl:template name="system_cache__appinfo:position">
  941. <xsl:param name="xml"/>
  942. <xsl:for-each select="$xml/*">
  943. <xsl:if test="name()">
  944. <xsl:element name="{name()}">
  945. <xsl:attribute name="system_cache__appinfo:position" select="position()"/>
  946. <xsl:apply-templates mode="system_cache__appinfo:position" select="@*"/>
  947. <xsl:call-template name="system_cache__appinfo:position">
  948. <xsl:with-param name="xml" select="."/>
  949. </xsl:call-template>
  950. </xsl:element>
  951. </xsl:if>
  952. </xsl:for-each>
  953. </xsl:template>
  954. <xsl:template match="@*" mode="system_cache__appinfo:position">
  955. <xsl:attribute name="{name()}" select="."/>
  956. </xsl:template>
  957. <xsl:template match="text()" mode="system_cache__appinfo:position"/>
  958. <xsl:template match="comment()" mode="system_cache__appinfo:position"/>
  959. </xsl:stylesheet>