get_all_xsd.xsl 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  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(/), concat($external_schema,'/'))">
  502. <xsl:comment>#145 Ignored /public_html/external_schema <xsl:value-of select="document-uri(/)"/></xsl:comment>
  503. <system_cache__appinfo:get_all_xsd_external_schema>
  504. <xsl:attribute name="system_cache__appinfo:document-uri" select="system_cache__appinfo:document-uri_for_external_schema_id_namespace_prefix(document-uri(/))"/>
  505. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="system_cache__appinfo:document-uri-full_for_external_schema_id_namespace_prefix(document-uri(/))"/>
  506. <xsl:attribute name="system_cache__appinfo:document-uri-orig" select="substring-after(document-uri(/), $external_schema)"/>
  507. <!--<xsl:attribute name="system_cache__appinfo:document-uri-full-orig" select="document-uri(/)"/>-->
  508. <!--<xsl:for-each select="//schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  509. <xsl:element name="{name()}">
  510. <xsl:for-each select="@*">
  511. <xsl:attribute name="{name()}" select="."/>
  512. <xsl:copy-of select="child::node()"/>
  513. </xsl:for-each>
  514. </xsl:element>
  515. </xsl:for-each>-->
  516. <!--<xsl:copy-of select="/"/>-->
  517. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema" select=".">
  518. <xsl:with-param name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  519. </xsl:apply-templates>
  520. </system_cache__appinfo:get_all_xsd_external_schema>
  521. </xsl:when>
  522. <xsl:when test=" contains(document-uri(/), concat($external_schema_id_namespace_prefix,'/'))">
  523. <xsl:comment>#248 Ignored /public_html/external_schema_id_namespace_prefix <xsl:value-of select="document-uri(/)"/></xsl:comment>
  524. <system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
  525. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  526. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  527. <xsl:attribute name="system_cache__appinfo:document-uri-orig" select="substring-after(document-uri(/), $external_schema_id_namespace_prefix)"/>
  528. <!--<xsl:for-each select="//schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  529. <xsl:element name="{name()}">
  530. <xsl:for-each select="@*">
  531. <xsl:attribute name="{name()}" select="."/>
  532. <xsl:copy-of select="child::node()"/>
  533. </xsl:for-each>
  534. </xsl:element>
  535. </xsl:for-each>-->
  536. <!--<xsl:copy-of select="/"/>-->
  537. <xsl:apply-templates mode="system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix" select=".">
  538. <xsl:with-param name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  539. </xsl:apply-templates>
  540. </system_cache__appinfo:get_all_xsd_external_schema_id_namespace_prefix>
  541. </xsl:when>
  542. <xsl:when test=" contains(document-uri(/), $default_db_xml_cache.public)">
  543. <system_cache__appinfo:get_all_xsd.default_db_xml_cache.public>
  544. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  545. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  546. <xsl:copy-of select="/"/>
  547. </system_cache__appinfo:get_all_xsd.default_db_xml_cache.public>
  548. </xsl:when>
  549. <xsl:when test=" contains(document-uri(/), $default_db.dir)">
  550. <system_cache__appinfo:get_all_xsd_default_db>
  551. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  552. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  553. <xsl:copy-of select="/"/>
  554. </system_cache__appinfo:get_all_xsd_default_db>
  555. </xsl:when>
  556. <xsl:when test=" contains(document-uri(/), $external_schema_table.path)">
  557. <system_cache__appinfo:get_all_xsd_external_schema_table>
  558. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  559. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  560. <xsl:copy-of select="/"/>
  561. </system_cache__appinfo:get_all_xsd_external_schema_table>
  562. </xsl:when>
  563. <xsl:when test=" contains(document-uri(/), $WPS_Functions)">
  564. <xsl:comment>#700 NOT ignored schema by contains(document-uri(/), $WPS_Functions)</xsl:comment>
  565. <xsl:message>#700 NOT ignored schema by contains(document-uri(/), $WPS_Functions)</xsl:message>
  566. <system_cache__appinfo:get_all_xsd>
  567. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  568. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  569. <xsl:attribute name="WPS_Functions" select="$WPS_Functions"/>
  570. <xsl:copy-of select="/"/>
  571. </system_cache__appinfo:get_all_xsd>
  572. </xsl:when>
  573. <xsl:when test=" contains(document-uri(/), $procesy5_system_schema_collection_dir)">
  574. <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>
  575. <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>
  576. <system_cache__appinfo:get_all_xsd>
  577. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), $procesy5_system_schema_collection_dir)"/>
  578. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  579. <xsl:attribute name="WPS_Functions" select="$WPS_Functions"/>
  580. <xsl:copy-of select="/"/>
  581. </system_cache__appinfo:get_all_xsd>
  582. </xsl:when>
  583. <xsl:otherwise>
  584. <xsl:comment>#641 Otherwise - try substring after /public_html from <xsl:value-of select="document-uri(/)"/></xsl:comment>
  585. <xsl:message>#641 Otherwise - try substring after /public_html from <xsl:value-of select="document-uri(/)"/></xsl:message>
  586. <system_cache__appinfo:get_all_xsd>
  587. <xsl:attribute name="system_cache__appinfo:document-uri" select="substring-after(document-uri(/), '/public_html/')"/>
  588. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="document-uri(/)"/>
  589. <!--<xsl:for-each select="//schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  590. <xsl:element name="{name()}">
  591. <xsl:for-each select="@*">
  592. <xsl:attribute name="{name()}" select="."/>
  593. <xsl:copy-of select="child::node()"/>
  594. </xsl:for-each>
  595. </xsl:element>
  596. </xsl:for-each>-->
  597. <xsl:copy-of select="/"/>
  598. </system_cache__appinfo:get_all_xsd>
  599. </xsl:otherwise>
  600. </xsl:choose>
  601. </xsl:for-each>
  602. <!-- -->
  603. <xsl:message> schemat dla XML primitives <xsl:value-of select="'http://www.w3.org/1999/XSL/Transform'"/></xsl:message>
  604. <system_cache__appinfo:get_all_xsd>
  605. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  606. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  607. <xsl:copy-of select="$system_cache__appinfo:primitives.xsd"/>
  608. </system_cache__appinfo:get_all_xsd>
  609. <xsl:message> schemat dla XML primitives/derived <xsl:value-of select="'http://www.w3.org/1999/XSL/Transform'"/></xsl:message>
  610. <system_cache__appinfo:get_all_xsd>
  611. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  612. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  613. <xsl:copy-of select="$system_cache__appinfo:derived.xsd"/>
  614. </system_cache__appinfo:get_all_xsd>
  615. <system_cache__appinfo:get_all_xsd>
  616. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  617. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  618. <xsl:copy-of select="$system_cache__appinfo:XMLSchema11.xsd"/>
  619. </system_cache__appinfo:get_all_xsd>
  620. <system_cache__appinfo:get_all_xsd>
  621. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://www.w3.org/1999/XSL/Transform'"/>
  622. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://www.w3.org/1999/XSL/Transform'"/>
  623. <xsl:copy-of select="$system_cache__appinfo:builtintypes.xsd"/>
  624. </system_cache__appinfo:get_all_xsd>
  625. <system_cache__appinfo:get_all_xsd>
  626. <xsl:attribute name="system_cache__appinfo:document-uri" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
  627. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="'http://biuro.biall-net.pl/p5/schema/types'"/>
  628. <xsl:copy-of select="$system_cache__appinfo:p5Type.xsd"/>
  629. </system_cache__appinfo:get_all_xsd>
  630. </system_cache__appinfo:get_all_xsd_list>
  631. </xsl:variable>
  632. <!--<xsl:result-document href="{concat('../default_db.instance.xml/transformed/',$element-filename,'.xml')}">
  633. <xsl:copy-of select="$procesy5_system_schema"/>
  634. </xsl:result-document>-->
  635. <xsl:copy-of select="$procesy5_system_schema"></xsl:copy-of>
  636. </xsl:otherwise>
  637. </xsl:choose>
  638. </xsl:template>
  639. <!--TODO DISABLED TEMPORARY - IF IS USED? <xsl:template name="system_cache__appinfo:vrtfNamespaces"><!-\- consider namespaces for get_all_xsd_external_schema -\->
  640. <xsl:variable name="procesy5_system_schema">
  641. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  642. <xsl:with-param name="path2collection" select="$procesy5_system_schema_collection_dir"/>
  643. <xsl:with-param name="cache" select="'read'"/>
  644. </xsl:call-template>
  645. </xsl:variable>
  646. <system_cache__appinfo:vrtfNamespaces>
  647. <xsl:for-each select="$procesy5_system_schema/system_cache__appinfo:get_all_xsd_list/system_cache__appinfo:get_all_xsd/schema/namespace::node()"
  648. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  649. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  650. </xsl:for-each>
  651. </system_cache__appinfo:vrtfNamespaces>
  652. </xsl:template>-->
  653. <!--<xsl:template name="system_cache__appinfo:vrtfNamespaces_external_schema">
  654. <xsl:variable name="procesy5_system_schema">
  655. <xsl:call-template name="system_cache__appinfo:get_all_xsd">
  656. <xsl:with-param name="path2collection" select="$procesy5_system_schema_collection_dir"/>
  657. <xsl:with-param name="cache" select="'read'"/>
  658. </xsl:call-template>
  659. </xsl:variable>
  660. <system_cache__appinfo:vrtfNamespaces_external_schema>
  661. <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()"
  662. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  663. <ns element="{name(..)}" prefix="{name()}" uri="{.}"/>
  664. </xsl:for-each>
  665. </system_cache__appinfo:vrtfNamespaces_external_schema>
  666. </xsl:template>-->
  667. <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:vrtfNamespaces">
  668. <system_cache__appinfo:vrtfNamespaces>
  669. <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()"
  670. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  671. <ns element="{name(..)}" prefix="{name()}" uri="{.}" system_cache__appinfo:document-uri="{../../@system_cache__appinfo:document-uri}"/>
  672. </xsl:for-each>
  673. <xsl:for-each select="//system_cache__appinfo:get_all_xsd_default_db/schema"
  674. xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  675. <xsl:variable name="targetNamespace" select="@targetNamespace"/>
  676. <xsl:choose>
  677. <xsl:when test="namespace::node()=$targetNamespace">
  678. <xsl:message>#701-A OK $targetNamespace <xsl:value-of select="$targetNamespace"/> has declared prefix </xsl:message>
  679. </xsl:when>
  680. <xsl:otherwise>
  681. <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>
  682. <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}"/>
  683. </xsl:otherwise>
  684. </xsl:choose>
  685. </xsl:for-each>
  686. </system_cache__appinfo:vrtfNamespaces>
  687. </xsl:template>
  688. <!--<xsl:function name="system_cache__resources_tree_generate_xsl_required_occurs_raport:element-filename">
  689. <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 -\->
  690. <xsl:param name="parent_type"/>
  691. <xsl:choose>
  692. <xsl:when test="$template_context='system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_element'">
  693. <xsl:value-of select="concat($default_db.instance.xml,'/detect_resource_type/element-',system_cache__appinfo:escape_object_prefix_to_string($parent_type),'.xml')"/>
  694. </xsl:when>
  695. <xsl:when test="$template_context='system_cache__resources_tree_generate_xsl_required_occurs_raport:detect_resource_type.single_complexType'">
  696. <xsl:value-of select="concat($default_db.instance.xml,'/detect_resource_type/complexType-',system_cache__appinfo:escape_object_prefix_to_string($parent_type),'.xml')"/>
  697. </xsl:when>
  698. <xsl:otherwise><xsl:message terminate="yes">#767 unknown type $template_context=<xsl:value-of select="$template_context"/></xsl:message></xsl:otherwise>
  699. </xsl:choose>
  700. </xsl:function>
  701. -->
  702. <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:element_complexType">
  703. <xsl:param name="targetNamespace" select="$targetNamespace_DEFAULTS"/>
  704. <system_cache__appinfo:element_complexType>
  705. <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">
  706. <xsl:variable name="get_all_xsd_236" select="."/>
  707. <xsl:comment>
  708. 246:detect_resource_type, przetwarzam schemat:<xsl:value-of select="@system_cache__appinfo:document-uri"/>; $targetNamespace:<xsl:value-of select="$targetNamespace"/>;
  709. @targetNamespace:<xsl:value-of select="schema/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>;</xsl:comment>
  710. <xsl:variable name="schema_node_144" select="."/>
  711. <xsl:for-each select="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!--[ @targetNamespace != $targetNamespace ] namespace::node() = $targetNamespace and @targetNamespace='moj_ogrodek' -->
  712. <xsl:message>#239::detect_resource_type przetwarzam schemat:@targetNamespace:<xsl:value-of select="@targetNamespace"/>;</xsl:message>
  713. <xsl:variable name="prefix_83" select="namespace::node()[. = $targetNamespace]/name()"/>
  714. <xsl:variable name="targetNamespace_134" select="@targetNamespace"/>
  715. <!--<xsl:variable name="prefix_134" select="namespace::node()[. = $targetNamespace_134][1]/name()"/>--><!-- np. test_objects -->
  716. <xsl:variable name="prefix_134">
  717. <xsl:choose>
  718. <xsl:when test="string-length(namespace::node()[. = $targetNamespace_134][1]/name()) &gt; 0">
  719. <xsl:value-of select="namespace::node()[. = $targetNamespace_134][1]/name()"/>
  720. <xsl:message>#784-A TODO test=<xsl:value-of select="namespace::node()[. = $targetNamespace_134][1]/name()"/>;</xsl:message>
  721. </xsl:when>
  722. <xsl:when test="$schema_node_144/@WPS_Functions">
  723. <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>
  724. <xsl:value-of select="tokenize(../@system_cache__appinfo:document-uri,'/')[ position() = last()]"/>
  725. </xsl:when>
  726. <xsl:when test="contains(../@system_cache__appinfo:document-uri-full,$p5Type.basedir)">
  727. <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>
  728. <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(@targetNamespace)"/>
  729. </xsl:when>
  730. </xsl:choose>
  731. </xsl:variable>
  732. <xsl:if test="not(@targetNamespace) or not( string-length($prefix_134) &gt; 1) ">
  733. <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>
  734. </xsl:if>
  735. <xsl:choose>
  736. <xsl:when test="@targetNamespace='http://www.w3.org/2001/XMLSchema'"/>
  737. <xsl:when test="@targetNamespace='http://biuro.biall-net.pl/p5/schema/types'"/>
  738. <xsl:when test="contains(@system_cache__appinfo:document-uri-full,'http://')"/>
  739. <xsl:when test="contains(@system_cache__appinfo:document-uri-full,'https://')"/>
  740. <xsl:otherwise>
  741. <xsl:element name="system_cache__appinfo:object_install_se_ant_object.generate_tables_from_external.get_all_xsd">
  742. <xsl:copy-of select="@*"/>
  743. <xsl:copy-of select=".././@*"/>
  744. </xsl:element>
  745. </xsl:otherwise>
  746. </xsl:choose>
  747. <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">
  748. <xsl:for-each select="(element|complexType)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><!-- dla ograniczenia mozna [$prefix_134='test_objects']-->
  749. <xsl:variable name="complexType_or_element_name186">
  750. <xsl:choose>
  751. <xsl:when test="local-name()='element'"><xsl:value-of select="@name"/></xsl:when>
  752. <xsl:when test="local-name()='complexType'"><xsl:value-of select="@name"/></xsl:when>
  753. <xsl:otherwise><xsl:message terminate="yes">#391 it should work only for element or complexType</xsl:message></xsl:otherwise>
  754. </xsl:choose>
  755. </xsl:variable>
  756. <xsl:comment>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:comment>
  757. <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>
  758. <xsl:choose>
  759. <xsl:when test="local-name()='element'">
  760. <build_cache name="build_element">
  761. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  762. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  763. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  764. <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)"/>
  765. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  766. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  767. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  768. <!--<xsl:attribute name="system_cache__appinfo:element-filename" select="system_cache__appinfo:element-filename()"/>-->
  769. <with-param name="element" select="{$prefix_134}:{$complexType_or_element_name186}"/>
  770. <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>
  771. <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>
  772. <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>
  773. <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>
  774. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  775. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  776. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  777. <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>
  778. <!--<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>-->
  779. </build_cache>
  780. </xsl:when>
  781. <xsl:when test="local-name()='complexType'">
  782. <build_cache name="build_complexType">
  783. <xsl:attribute name="id.int.rand" select="system_cache__appinfo:id.int.rand(@id)"/>
  784. <!--<xsl:message>#808.1.DEBUG ok</xsl:message>-->
  785. <xsl:attribute name="system_cache__appinfo:document-uri" select="../.././@system_cache__appinfo:document-uri"/>
  786. <!--<xsl:message>#808.2.DEBUG ok</xsl:message>-->
  787. <xsl:attribute name="system_cache__appinfo:document-uri-full" select="../.././@system_cache__appinfo:document-uri-full"/>
  788. <!--<xsl:message>#808.3.DEBUG ok</xsl:message>-->
  789. <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)"/>
  790. <!--<xsl:message>#808.4.DEBUG ok</xsl:message>-->
  791. <xsl:attribute name="complexType_or_element_name" select="$complexType_or_element_name186"/>
  792. <!--<xsl:message>#808.5.DEBUG ok</xsl:message>-->
  793. <xsl:attribute name="p5opr:element-filename" select="p5opr:element-filename(../.././@system_cache__appinfo:document-uri, .././@targetNamespace,local-name(),@name)"/>
  794. <!--<xsl:message>#808.6.DEBUG ok</xsl:message>-->
  795. <xsl:attribute name="system_cache__appinfo:path" select="concat(../@targetNamespace,'/',$complexType_or_element_name186)"/>
  796. <with-param name="complexType"
  797. select="{$prefix_134}:{$complexType_or_element_name186}"/>
  798. <!--<xsl:message>#808.7.DEBUG ok</xsl:message>-->
  799. <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>
  800. <!--<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>-->
  801. <!--<xsl:message>#808.8.DEBUG ok</xsl:message>-->
  802. <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>
  803. <!--<xsl:message>#808.9.DEBUG ok</xsl:message>-->
  804. <system_cache__appinfo:targetNamespace><xsl:value-of select="../@targetNamespace"/></system_cache__appinfo:targetNamespace>
  805. <system_cache__appinfo:name><xsl:value-of select="@name"/></system_cache__appinfo:name>
  806. <system_cache__appinfo:prefix><xsl:value-of select="$prefix_134"/></system_cache__appinfo:prefix>
  807. <!--<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>-->
  808. </build_cache>
  809. </xsl:when>
  810. </xsl:choose>
  811. </xsl:for-each>
  812. </xsl:if>
  813. </xsl:for-each>
  814. </xsl:for-each>
  815. </system_cache__appinfo:element_complexType>
  816. </xsl:template>
  817. <!-- do aktualizowania pozycji w schemache-->
  818. <xsl:template name="system_cache__appinfo:position">
  819. <xsl:param name="xml"/>
  820. <xsl:for-each select="$xml/*">
  821. <xsl:if test="name()">
  822. <xsl:element name="{name()}">
  823. <xsl:attribute name="system_cache__appinfo:position" select="position()"/>
  824. <xsl:apply-templates mode="system_cache__appinfo:position" select="@*"/>
  825. <xsl:call-template name="system_cache__appinfo:position">
  826. <xsl:with-param name="xml" select="."/>
  827. </xsl:call-template>
  828. </xsl:element>
  829. </xsl:if>
  830. </xsl:for-each>
  831. </xsl:template>
  832. <xsl:template match="@*" mode="system_cache__appinfo:position">
  833. <xsl:attribute name="{name()}" select="."/>
  834. </xsl:template>
  835. <xsl:template match="text()" mode="system_cache__appinfo:position"/>
  836. <xsl:template match="comment()" mode="system_cache__appinfo:position"/>
  837. </xsl:stylesheet>