get_all_xsd.xsl 90 KB

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