get_all_xsd.xsl 79 KB

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