p5dkp.generated.xsl 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
  5. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  6. xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
  7. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
  9. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  10. xmlns:p5xsda="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsd_asserts/p5xsda.xsd"
  11. xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"
  12. xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
  13. xmlns:p5dkp.entities-generated="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities-generated.xsd"
  14. xmlns:p5dkp.entities="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities.xsd"
  15. xmlns:p5dkp-er="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities-relations.xsd"
  16. xmlns:p5frc="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/flat_relation_cache/p5frc.xsd"
  17. exclude-result-prefixes="xs ditaarch"
  18. version="2.0">
  19. <xsl:output indent="yes" method="xml" exclude-result-prefixes="ditaarch"/>
  20. <!--<xsl:output indent="yes" method="xml" standalone="no" doctype-public="-//OASIS//DTD DITA Glossary Group//EN" doctype-system="glossgroup.dtd"/>-->
  21. <xsl:strip-space elements="*"/>
  22. <xsl:param name="p5dkp.entities-generated:basedir"/>
  23. <xsl:param name="p5dkp.entities-generated:debug"/>
  24. <xsl:param name="p5dkp:xsd" required="yes"/>
  25. <xsl:param name="p5dkp.entities:xsd" required="yes"/>
  26. <xsl:param name="p5dkp.repository" required="yes"/> <!-- will output there -->
  27. <xsl:param name="p5dkp.entities-generated:xsd" required="yes"/>
  28. <xsl:param name="p5dkp.entities-generated.xsd.p5frc.build_complexType.xml" required="yes"/>
  29. <xsl:param name="p5dkp-er:xsd" required="yes"/>
  30. <xsl:param name="p5dkp-er:prefix.prefix" select="'p5dkp-er.'"/>
  31. <xsl:param name="p5dkp-er:file.prefix" select="'p5dkp-er.'"/>
  32. <xsl:param name="p5dkp-er:targetNamespace.fragment" select="'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities.'"/>
  33. <xsl:param name="p5dkp.entities-generated:entity.name.prefix" select="'entities__x3A__'"/>
  34. <xsl:param name="p5dkp.entities:prefix" select="'p5dkp.entities'"/> <!-- to replace to local -->
  35. <xsl:param name="p5dkp.generated.xsd" required="yes"/>
  36. <xsl:include href="p5dkp.entities-generated.functions.xsl"/>
  37. <xsl:include href="../flat_relation_cache/p5frc.build_complexType.xsl"/>
  38. <!-- template to generate from p5dkp.entities-relations.xsd
  39. p5dkp.entities-generated.xsd (like p5dkp:xsd )
  40. with flat_relation_cache and asserts calculations to then follow
  41. -->
  42. <xsl:template mode="p5dkp.entities-generated:p5frc.build_complexType.xml" match="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  43. <xs:schema>
  44. <xsl:copy-of select="@vc:minVersion"/>
  45. <xsl:copy-of select="@elementFormDefault"/>
  46. <xsl:copy-of select="namespace::*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  47. <xsl:attribute name="targetNamespace" select="'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd'"/>
  48. <xsl:comment>#62 testing spaces</xsl:comment>
  49. <!--<xsl:copy copy-namespaces="no">
  50. <xsl:copy-of select="@vc:minVersion"/>
  51. <xsl:copy-of select="@elementFormDefault"/>
  52. <xsl:attribute name="targetNamespace" select="'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities-generated.xsd'"/>-->
  53. <xsl:if test="number($p5dkp.entities-generated:debug) &gt; 3"><xsl:message>#61 match p5dkp.entities-generated:p5frc.build_complexType.xml</xsl:message></xsl:if>
  54. <xsl:apply-templates mode="p5frc:build_complexType" select="*"/>
  55. <!--</xsl:copy>-->
  56. </xs:schema>
  57. </xsl:template>
  58. <xsl:template mode="p5dkp.entities-generated:generated.xsd" match="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  59. <xs:schema>
  60. <xsl:copy-of select="namespace::*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  61. <xsl:copy-of select="@vc:minVersion"/>
  62. <xsl:copy-of select="@elementFormDefault"/>
  63. <xsl:copy-of select="@targetNamespace"/>
  64. <!--<xsl:attribute name="targetNamespace" select="'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.entities-generated.xsd'"/>-->
  65. <xsl:if test="number($p5dkp.entities-generated:debug) &gt; 3"><xsl:message>#63 match mode="p5dkp.entities-generated:xsd" match="schema" </xsl:message></xsl:if>
  66. <xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  67. <xsl:comment>#85 todo attributes to some defaults</xsl:comment>
  68. <xs:attribute name="id" type="p5dkp.entities:id"/>
  69. <xs:attribute name="idref" type="xs:IDREF"/>
  70. <xs:simpleType name="dita.ID">
  71. <xs:annotation>
  72. <xs:documentation>Dziedziczone z typów DITA</xs:documentation>
  73. </xs:annotation>
  74. <xs:restriction base="xs:ID"/>
  75. </xs:simpleType>
  76. </xs:schema>
  77. </xsl:template>
  78. <xsl:template mode="p5dkp.entities-generated:p5xsda.sort" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  79. <xsl:param name="p5dkp.entities-generated:entity" required="yes"/>
  80. <xsl:choose>
  81. <xsl:when test=".//p5xsda:sort">
  82. <xsl:apply-templates xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="#current">
  83. <xsl:with-param name="p5dkp.entities-generated:entity" select="$p5dkp.entities-generated:entity"/>
  84. </xsl:apply-templates>
  85. </xsl:when>
  86. </xsl:choose>
  87. </xsl:template>
  88. <xsl:template mode="p5dkp.entities-generated:p5xsda.sort" match="p5xsda:sort" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  89. <xsl:param name="p5dkp.entities-generated:entity" required="yes"/>
  90. <xsl:copy copy-namespaces="no">
  91. <xsl:apply-templates mode="#current" select="@*">
  92. <xsl:with-param name="p5dkp.entities-generated:entity" select="$p5dkp.entities-generated:entity"/>
  93. </xsl:apply-templates>
  94. </xsl:copy>
  95. </xsl:template>
  96. <xsl:template mode="p5dkp.entities-generated:p5xsda.sort" match="@p5xsda:sort.element">
  97. <xsl:param name="p5dkp.entities-generated:entity" required="yes"/>
  98. <xsl:attribute name="p5xsda:sort.element" select="p5dkp.entities-generated:fix.entity.name(.,$p5dkp.entities-generated:entity)"/>
  99. </xsl:template>
  100. <xsl:template mode="p5dkp.entities-generated:p5xsda.sort" match="@*">
  101. <xsl:copy-of select="."/>
  102. </xsl:template>
  103. <xsl:template mode="p5dkp.entities-generated:generated.xsd" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="complexType[ not( ancestor::complexType)]">
  104. <xsl:comment>#126 ROOOTROOOTROOOTROOT NA REFS NOW run mode="p5dkp.entities-generated:generated.xsd.elements" </xsl:comment>
  105. <!--<DEBUYG_ANCESTORS>
  106. <xsl:attribute name="test1" select="complexType[ not( ancestor::complexType)]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  107. <xsl:attribute name="test2" select="ancestor::complexType/@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  108. <dig>
  109. <xsl:copy-of select="ancestor::complexType"></xsl:copy-of>
  110. </dig>
  111. </DEBUYG_ANCESTORS>-->
  112. <xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd.elements" select="." xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  113. <xsl:comment>#126 EOF ROOT EOF ROOT _ TERAZ COMPLEXTYPES BEZ REFS run mode="p5dkp.entities-generated:generated.xsd.elements" </xsl:comment>
  114. <xsl:copy copy-namespaces="yes">
  115. <xsl:copy-of select="@*"/>
  116. <xsl:message>#129 mode="p5dkp.entities-generated:generated.xsd"</xsl:message>
  117. <!-- <xs:complexContent>
  118. <xs:extension base="{$p5dkp-er:prefix.prefix}{@name}:{@name}">
  119. <xs:sequence>
  120. -->
  121. <xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  122. <!--
  123. <xs:element maxOccurs="unbounded" ref="p5dkp:{@name}" minOccurs="0">
  124. <xs:annotation>
  125. <xs:appinfo>
  126. <xsl:comment>#116 try p5dkp.entities-generated:p5xsda.sort</xsl:comment>
  127. <xsl:apply-templates mode="p5dkp.entities-generated:p5xsda.sort">
  128. <xsl:with-param name="p5dkp.entities-generated:entity" select="@name"/>
  129. </xsl:apply-templates>
  130. <!-\-<p5xsda:sort p5xsda:sort.element="etap_prio" p5xsda:sort="ascending"/>-\->
  131. <system_cache__appinfo:flat_relation_cache>
  132. <system_cache__appinfo:source system_cache__appinfo:ref_engine="view" system_cache__appinfo:name="role_no" system_cache__appinfo:xpath="p5dkp:wymagania/role_no"/>
  133. </system_cache__appinfo:flat_relation_cache>
  134. </xs:appinfo>
  135. </xs:annotation>
  136. </xs:element>
  137. <xs:element maxOccurs="unbounded" minOccurs="0" ref="p5dkp:zadanie">
  138. <xs:annotation>
  139. <xs:appinfo>
  140. <xsl:comment>#116 try p5dkp.entities-generated:p5xsda.sort</xsl:comment>
  141. <xsl:apply-templates mode="p5dkp.entities-generated:p5xsda.sort">
  142. <xsl:with-param name="p5dkp.entities-generated:entity" select="@name"/>
  143. </xsl:apply-templates>
  144. <!-\-<p5xsda:sort p5xsda:sort.element="etap_prio" p5xsda:sort="ascending"/>-\->
  145. <system_cache__appinfo:flat_relation_cache>
  146. <system_cache__appinfo:source system_cache__appinfo:ref_engine="view" system_cache__appinfo:name="role_no" system_cache__appinfo:xpath="p5dkp:zadanie/role_no"/>
  147. </system_cache__appinfo:flat_relation_cache>
  148. </xs:appinfo>
  149. </xs:annotation>
  150. </xs:element>
  151. <xs:element minOccurs="0" ref="p5dkp:worker" maxOccurs="unbounded">
  152. <xs:annotation>
  153. <xs:appinfo>
  154. <!-\-<p5xsda:sort p5xsda:sort.element="etap_prio" p5xsda:sort="ascending"/>-\->
  155. <xsl:comment>#145 try p5dkp.entities-generated:p5xsda.sort</xsl:comment>
  156. <xsl:apply-templates mode="p5dkp.entities-generated:p5xsda.sort">
  157. <xsl:with-param name="p5dkp.entities-generated:entity" select="@name"/>
  158. </xsl:apply-templates>
  159. <system_cache__appinfo:flat_relation_cache>
  160. <system_cache__appinfo:source system_cache__appinfo:ref_engine="view" system_cache__appinfo:name="role_no" system_cache__appinfo:xpath="p5dkp:worker/role_no"/>
  161. </system_cache__appinfo:flat_relation_cache>
  162. </xs:appinfo>
  163. </xs:annotation>
  164. </xs:element>
  165. -->
  166. <!--</xs:sequence>
  167. </xs:extension>
  168. </xs:complexContent>-->
  169. </xsl:copy>
  170. </xsl:template>
  171. <xsl:template mode="p5dkp.entities-generated:assert" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="*">
  172. <xsl:comment>#186 TODO mode="p5dkp.entities-generated:assert" </xsl:comment>
  173. <!--<xs:assert test="wymagania_role_time_sum = sum(p5dkp:role/number(role_time))">
  174. <xs:annotation>
  175. <xs:appinfo>
  176. <p5xsda:after>wymagania_no</p5xsda:after>
  177. </xs:appinfo>
  178. <xs:documentation>after wymagania_prio</xs:documentation>
  179. </xs:annotation>
  180. </xs:assert>-->
  181. </xsl:template>
  182. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="complexType[ parent::schema ]">
  183. <xsl:comment>#201 match="complexType[ parent::schema ]" </xsl:comment>
  184. <xs:element name="{@name}">
  185. <xsl:if test="string-length(@id) &gt; 0 "><xsl:copy-of select="@id"/></xsl:if>
  186. <xs:complexType>
  187. <xs:complexContent>
  188. <xs:extension base="p5dkp:{@name}">
  189. <xs:sequence>
  190. <xsl:variable name="er.entity.no.local" select="@name"/>
  191. <xsl:variable name="er.entity.local" select="concat($p5dkp-er:prefix.prefix,@name)"/>
  192. <xsl:comment>#216 to tutaj - dajemy apply p5dkp.entities-generated:generated.xsd.elements.refs </xsl:comment>
  193. <!--<xsl:apply-templates mode="p5dkp.entities-generated:assert">
  194. <xsl:with-param name="p5dkp.entities-generated:entity" select="@name"/>
  195. </xsl:apply-templates>-->
  196. <xsl:variable name="p5frc:entity.relation.source">
  197. <xsl:apply-templates mode="p5frc:entity.relation.source" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  198. </xsl:variable>
  199. <xsl:variable name="p5dkp.entities-generated:generated.xsd.elements.refs">
  200. <xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd.elements.refs" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  201. <xsl:with-param name="p5frc:entity.relation.source" select="$p5frc:entity.relation.source"/>
  202. </xsl:apply-templates>
  203. </xsl:variable>
  204. <!--<xsl:comment>#231 generujemy relacje do obiektow obcych sequence/element
  205. ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### #######
  206. ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### #######
  207. ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### #######
  208. </xsl:comment>-->
  209. <!--<xsl:copy-of select="$p5dkp.entities-generated:generated.xsd.elements.refs"/>-->
  210. <!-- ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### -->
  211. <xsl:variable name="p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique">
  212. <p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique>
  213. <xsl:for-each-group select="$p5dkp.entities-generated:generated.xsd.elements.refs/sequence/group" group-by="@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  214. <xsl:copy>
  215. <xsl:variable name="emtities.group" select="@name"/>
  216. <xsl:copy-of select="@*"/>
  217. <er.entity_to_entities.type.list>
  218. <xsl:for-each-group select="current-group()/sequence/element" group-by="substring-before(@type,':')">
  219. <er.entity_to_entities.type>
  220. <xsl:variable name="er.entity" select="substring-before(@type,':')"/>
  221. <xsl:variable name="er.entity.no" select="substring-after(substring-before(@type,':'),$p5dkp-er:prefix.prefix)"/>
  222. <xsl:attribute name="er.entity" select="$er.entity"/>
  223. <xsl:attribute name="er.entity.no" select="$er.entity.no"/>
  224. <xsl:copy-of select="@*"/>
  225. <xsl:attribute name="element" select="local-name()"/>
  226. <xsl:attribute name="uses.emtities.group" select="$emtities.group"/>
  227. <wykrywamy_klucze>
  228. <xsl:attribute name="er.entity.no.local" select="$er.entity.no.local"/>
  229. <xsl:attribute name="er.entity.local" select="$er.entity.local"/>
  230. <xsl:attribute name="system_cache__appinfo:ref_engine" select="'view'"/>
  231. <xsl:choose>
  232. <xsl:when test="string-length($er.entity) &lt; 1 or string-length($er.entity) &lt; 1">
  233. <xsl:message terminate="yes">#269 UNCORRECT string-length($er.entity) &lt; 1 or string-length($er.entity) &lt; 1</xsl:message>
  234. </xsl:when>
  235. <xsl:when test="$er.entity = $er.entity.local">
  236. <xsl:attribute name="czy_jest_lokalny_entities" select="'tak - $er.entity = $er.entity.local'"/>
  237. <xsl:choose>
  238. <xsl:when test="$emtities.group = 'entities.basic'">
  239. <xsl:attribute name="entities.basic.providing"/>
  240. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no')"/>
  241. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  242. </xsl:when>
  243. <xsl:when test="$emtities.group = 'entities.assert'">
  244. <xsl:attribute name="entities.assert.providing"/>
  245. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_assert.map')"/>
  246. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  247. </xsl:when>
  248. <xsl:when test="$emtities.group = 'entities.allocate'">
  249. <xsl:attribute name="entities.allocate.providing"/>
  250. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity,'_no')"/>
  251. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no_allocate.map')"/>
  252. </xsl:when>
  253. <xsl:when test="$emtities.group = 'entities.required_finished'">
  254. <xsl:attribute name="entities.required_finished.providing"/>
  255. <!--<xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_features')"/>-->
  256. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.local,'_features')"/>
  257. <xsl:attribute name="system_cache__appinfo:name.1" select="concat($er.entity.local,'_prio')"/>
  258. <xsl:attribute name="system_cache__appinfo:name.extra"><xsl:value-of select="$er.entity.no"/>_prio</xsl:attribute>
  259. </xsl:when>
  260. <xsl:when test="$emtities.group = 'entities.allocate.map'">
  261. <xsl:attribute name="entities.allocate.map.providing"/>
  262. </xsl:when>
  263. <xsl:when test="$emtities.group = 'entities.required_finished.map'">
  264. <xsl:attribute name="entities.required_finished.map.providing"/>
  265. </xsl:when>
  266. <xsl:when test="$emtities.group = 'entities.stricte.map'">
  267. <xsl:attribute name="entities.stricte.map.providing"/>
  268. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_stricte.map')"/>
  269. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  270. </xsl:when>
  271. <xsl:when test="$emtities.group = 'entities.allocate.map'">
  272. <xsl:attribute name="entities.stricte.map.providing"/>
  273. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_allocate.map')"/>
  274. <xsl:attribute name="system_cache__appinfo:xpath1" select="concat($er.entity.no,'_allocate_price.map')"/>
  275. <xsl:attribute name="system_cache__appinfo:xpath2" select="concat($er.entity.no,'_allocate_price_recur.map')"/>
  276. <xsl:attribute name="system_cache__appinfo:xpath3" select="concat($er.entity.no,'_allocate_price_recur_cond.map')"/>
  277. <xsl:attribute name="system_cache__appinfo:xpath4" select="concat($er.entity.no,'_allocate_time.map')"/>
  278. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  279. </xsl:when>
  280. <xsl:when test="$emtities.group = 'entities.group.map'">
  281. <xsl:attribute name="entities.group.map.providing"/>
  282. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_contained.map')"/>
  283. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  284. <xsl:attribute name="system_cache__appinfo:xpath.1" select="concat($er.entity.no,'_no_include.map')"/>
  285. <xsl:attribute name="system_cache__appinfo:name.1" select="concat($er.entity.no.local,'_no')"/>
  286. </xsl:when>
  287. <xsl:otherwise>
  288. <xsl:attribute name="providing_TODO" select="'othrerwise'" xpath-default-namespace=""/>
  289. </xsl:otherwise>
  290. </xsl:choose>
  291. </xsl:when>
  292. <xsl:otherwise>
  293. <xsl:attribute name="czy_jest_lokalny_entities" select="'nie'"/>
  294. <xsl:attribute name="DEBUG_TODO" select="'wychodzi ze trzeba dorobic kolejny model do kontekstow uzycia co sie jak laczy, analogicznie do tego manuala/aby to zasilalo ten komponent'"/>
  295. <xsl:choose>
  296. <xsl:when test="$emtities.group = 'entities.basic'">
  297. <xsl:attribute name="entities.basic.providing"/>
  298. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity,'_no')"/>
  299. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no_allocate.map')"/>
  300. </xsl:when>
  301. <xsl:when test="$emtities.group = 'entities.assert'">
  302. <xsl:attribute name="entities.assert.providing"/>
  303. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_assert.map')"/>
  304. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  305. </xsl:when>
  306. <xsl:when test="$emtities.group = 'entities.allocate'">
  307. <xsl:attribute name="entities.allocate.providing"/>
  308. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity,'_no')"/>
  309. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no_allocate.map')"/>
  310. </xsl:when>
  311. <xsl:when test="$emtities.group = 'entities.assert'">
  312. <xsl:attribute name="entities.assert.providing"/>
  313. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity,'_no')"/>
  314. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no_assert')"/>
  315. </xsl:when>
  316. <xsl:when test="$emtities.group = 'entities.required_finished'">
  317. <xsl:attribute name="entities.required_finished.providing"/>
  318. </xsl:when>
  319. <xsl:when test="$emtities.group = 'entities.allocate.map'">
  320. <xsl:attribute name="entities.allocate.providing"/>
  321. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity,'_no')"/>
  322. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no_allocate.map')"/>
  323. </xsl:when>
  324. <xsl:when test="$emtities.group = 'entities.required_finished.map'">
  325. <xsl:attribute name="entities.required_finished.map.providing"/>
  326. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity,'_no_required_finished.map')"/>
  327. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  328. </xsl:when>
  329. <xsl:when test="$emtities.group = 'entities.stricte.map'">
  330. <xsl:attribute name="entities.stricte.map.providing"/>
  331. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_stricte.map')"/>
  332. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  333. </xsl:when>
  334. <xsl:when test="$emtities.group = 'entities.group.map'">
  335. <xsl:attribute name="entities.group.map.providing"/>
  336. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_contained.map')"/>
  337. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  338. <xsl:attribute name="system_cache__appinfo:xpath.1" select="concat($er.entity.no,'_no_include.map')"/>
  339. <xsl:attribute name="system_cache__appinfo:name.1" select="concat($er.entity.no.local,'_no')"/>
  340. </xsl:when>
  341. <xsl:when test="$emtities.group = 'entities.allocate.map'">
  342. <xsl:attribute name="entities.stricte.map.providing"/>
  343. <xsl:attribute name="system_cache__appinfo:xpath" select="concat($er.entity.no,'_no_allocate.map')"/>
  344. <xsl:attribute name="system_cache__appinfo:xpath1" select="concat($er.entity.no,'_allocate_price.map')"/>
  345. <xsl:attribute name="system_cache__appinfo:xpath2" select="concat($er.entity.no,'_allocate_price_recur.map')"/>
  346. <xsl:attribute name="system_cache__appinfo:xpath3" select="concat($er.entity.no,'_allocate_price_recur_cond.map')"/>
  347. <xsl:attribute name="system_cache__appinfo:xpath4" select="concat($er.entity.no,'_allocate_time.map')"/>
  348. <xsl:attribute name="system_cache__appinfo:name" select="concat($er.entity.no.local,'_no')"/>
  349. </xsl:when>
  350. <xsl:otherwise>
  351. <xsl:attribute name="providing_TODO" select="'othrerwise'" xpath-default-namespace=""/>
  352. </xsl:otherwise>
  353. </xsl:choose>
  354. </xsl:otherwise>
  355. </xsl:choose>
  356. </wykrywamy_klucze>
  357. </er.entity_to_entities.type>
  358. </xsl:for-each-group>
  359. </er.entity_to_entities.type.list>
  360. </xsl:copy>
  361. </xsl:for-each-group>
  362. </p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique>
  363. </xsl:variable>
  364. <xsl:comment>#401 ##### #######################################################</xsl:comment>
  365. <xsl:for-each select="$p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique/p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique/*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  366. <!-- <xs:element id="{@id}">
  367. <xsl:attribute name="ref" select="concat('p5dkp.entities:',@name)"/>
  368. </xs:element>-->
  369. <xsl:for-each select="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  370. <xsl:for-each select="er.entity_to_entities.type" xpath-default-namespace="">
  371. <xsl:comment>#411 <xsl:value-of select="name()"/> <xsl:copy-of select="@*"/></xsl:comment>
  372. <xsl:choose>
  373. <xsl:when test="@er.entity.no and wykrywamy_klucze/@system_cache__appinfo:name and wykrywamy_klucze/@system_cache__appinfo:xpath">
  374. <xs:element ref="p5dkp:{@er.entity.no}">
  375. <xsl:if test="string-length(@id) &gt; 0 "><xsl:copy-of select="@id"/></xsl:if>
  376. <xs:annotation>
  377. <xs:appinfo>
  378. <system_cache__appinfo:flat_relation_cache>
  379. <system_cache__appinfo:source system_cache__appinfo:ref_engine="view" system_cache__appinfo:name="{wykrywamy_klucze/@system_cache__appinfo:name}" system_cache__appinfo:xpath="p5dkp:{@er.entity.no}/{wykrywamy_klucze/@system_cache__appinfo:xpath}"/>
  380. </system_cache__appinfo:flat_relation_cache>
  381. </xs:appinfo>
  382. </xs:annotation>
  383. </xs:element>
  384. </xsl:when>
  385. <xsl:otherwise>
  386. <xsl:comment>
  387. #429 somethinbg missing for <xsl:value-of select="@er.entity.no"/>
  388. </xsl:comment>
  389. </xsl:otherwise>
  390. </xsl:choose>
  391. </xsl:for-each>
  392. </xsl:for-each>
  393. </xsl:for-each>
  394. <!--<xsl:copy-of select="$p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique"/>-->
  395. <xsl:comment>#250 dla kazdej z grupy probuje zobaczyc z czym sie laczy i zrobic zaleznosc</xsl:comment>
  396. <xsl:variable name="er.entity.amalysis">
  397. <er.entity.amalysis>
  398. <xsl:for-each select="$p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique/p5dkp.entities-generated:generated.xsd.elements.refs.entity.groups.unique/*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  399. <dla_kazdego_szukam_powiazan>
  400. <xsl:attribute name="pos" select="position()"/>
  401. <xsl:copy-of select="@*"/>
  402. <xsl:variable name="entities.group" select="@name"/>
  403. <xsl:attribute name="entities.group" select="$entities.group"/>
  404. <xsl:for-each-group select="$p5dkp.entities-generated:generated.xsd.elements.refs/sequence/group[@name = $entities.group ]/sequence/element" group-by="substring-before(@type,':')" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  405. <element.no.to.entities.group.used>
  406. <xsl:variable name="er.entity" select="substring-before(@type,':')"/>
  407. <xsl:attribute name="er.entity" select="$er.entity"/>
  408. <xsl:attribute name="entities.group.local" select="../../@name"/>
  409. <xsl:attribute name="er.entity.no" select="substring-after(substring-before(@type,':'),$p5dkp-er:prefix.prefix)"/>
  410. <xsl:copy-of select="@*"/>
  411. <xsl:comment>#256 jedizemy dla kazdego typu allokacji zaleznosci - sprawdzmy dokad ma to er.entity powiazania - to jakich zaleznosci </xsl:comment>
  412. <!--<xsl:for-each-group select="$p5dkp.entities-generated:generated.xsd.elements.refs/sequence/group/sequence/element[@type=]"></xsl:for-each-group>-->
  413. </element.no.to.entities.group.used>
  414. </xsl:for-each-group>
  415. </dla_kazdego_szukam_powiazan>
  416. </xsl:for-each>
  417. </er.entity.amalysis>
  418. </xsl:variable>
  419. <!--<xsl:copy-of select="$er.entity.amalysis"/>-->
  420. <!-- ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### -->
  421. <xsl:comment>#288 generujemy relacje do obiektow obcych sequence/element
  422. ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### #######
  423. ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### #######
  424. ######## ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### #######
  425. </xsl:comment>
  426. </xs:sequence>
  427. </xs:extension>
  428. </xs:complexContent>
  429. </xs:complexType>
  430. </xs:element>
  431. </xsl:template>
  432. <xsl:template mode="p5frc:entity.relation.source" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="complexContent[extension[substring-after(@base,':')='entities'] ]"> <!-- [ substring-after(@base,':')='entities' and substring-before(@base,':')=$p5dkp.entities:prefix ]] -->
  433. <p5frc:entity.relation.source>
  434. <xsl:variable name="base.child.prefix" select=" substring-before(extension/@base,':')"/>
  435. <xsl:attribute name="p5frc:entity.relation.source.namespace" select="root()/schema/namespace::*[ name() = $base.child.prefix]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  436. <xsl:attribute name="p5dkp.entities:prefix" select="$p5dkp.entities:prefix"/>
  437. <xsl:attribute name="p5dkp.entities:entity.prefix" select="$base.child.prefix"/>
  438. <xsl:attribute name="element" select="name()"/>
  439. <xsl:attribute name="base.child" select="extension/@base" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  440. <xsl:attribute name="p5dkp.entities:entity.childs.count" select="count(.//*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  441. <attributes><xsl:copy-of select="@*"/></attributes>
  442. <xsl:comment>#250 note sprawdzamy zaleznosci pomiedzy lokalnym source
  443. czyli jak jhestesmy typ WYMAGANIA to mamy komus zrobione przez :
  444. group : p5dkp-er.role:entities.allocate.map -> role_no_allocate.map -> enitites_x3a__no , no.allocate , no.map, attriubutes itp
  445. lub p5dkp-er.etap:entities.group.map -> etap_no_contained.map -> etap_no_contained.map -> entities__x3A___no_contained.map _> no.contained -> no.map -> map @keyref , @p5dkp:idref
  446. - czyli trzeba odgadnac jak sie odpywac po ze moje lokalne etap_no_contained.map = w etapach etap_np
  447. </xsl:comment>
  448. </p5frc:entity.relation.source>
  449. </xsl:template>
  450. <xsl:template mode="p5frc:entity.relation.source" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="*">
  451. <xsl:message terminate="yes">#237 unatendet didnt found extension[ substring-after(@base,':')='entities'] = <xsl:value-of select="name()"/> ; <xsl:copy-of select="@*" copy-namespaces="no"/> </xsl:message>
  452. <p5frc:entity.relation.source.namespace_ERROR>
  453. <xsl:attribute name="p5frc:entity.relation.source.namespace" select="root()/schema/namespace::*[ . = current()/substring-before(@base,':')]/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  454. <xsl:attribute name="p5dkp.entities:prefix" select="$p5dkp.entities:prefix"/>
  455. <xsl:attribute name="element" select="name()"/>
  456. <attributes><xsl:copy-of select="@*"/></attributes>
  457. <sample><xsl:copy-of select=".//*[ position() &lt; 10]"/></sample>
  458. <xsl:message terminate="no">#237 unatendet didnt found extension[ substring-after(@base,':')='entities'] = <xsl:value-of select="name()"/> ; <xsl:copy-of select="@*" copy-namespaces="no"/> </xsl:message>
  459. <xsl:comment >#237 unatendet didnt found extension[ substring-after(@base,':')='entities'] = <xsl:value-of select="name()"/> ; <xsl:copy-of select="@*" copy-namespaces="no"/> </xsl:comment>
  460. </p5frc:entity.relation.source.namespace_ERROR>
  461. </xsl:template>
  462. <xsl:template name="p5frc:entity.relation.source.analys"><!-- TO ANALYZE NODES IF ARE REALTED DO DEST -->
  463. <xsl:param name="p5frc:entity.relation.source" required="yes"/>
  464. <xsl:param name="p5frc:entity.relation.dest" required="yes"/>
  465. <p5frc:entity.relation.source.analys>
  466. <!--<xsl:choose>
  467. <xsl:when test=""></xsl:when>
  468. </xsl:choose>-->
  469. </p5frc:entity.relation.source.analys>
  470. </xsl:template>
  471. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs.group" match="xs:sequence">
  472. <xsl:comment>#234 mode="p5dkp.entities-generated:generated.xsd.elements.refs.group" </xsl:comment>
  473. <xsl:for-each-group select="*" group-by="@ref">
  474. <xsl:copy-of select="."/>
  475. </xsl:for-each-group>
  476. </xsl:template>
  477. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="complexContent|extension" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  478. <xsl:param name="p5frc:entity.relation.source" required="yes"/>
  479. <xsl:apply-templates mode="#current" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  480. <xsl:with-param name="p5frc:entity.relation.source" select="$p5frc:entity.relation.source"/>
  481. </xsl:apply-templates>
  482. </xsl:template>
  483. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  484. <xsl:copy-of select="."/>
  485. </xsl:template>
  486. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="complexType[not( ancestor::complexType)]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  487. <xsl:param name="p5frc:entity.relation.source" required="yes"/>
  488. <xsl:comment>#228-C @id= <xsl:copy-of select="@*" copy-namespaces="no"/> disabled mode p5dkp.entities-generated:generated.xsd.elements.refs=<xsl:value-of select="name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> ; </xsl:comment>
  489. <xsl:copy-of select="$p5frc:entity.relation.source" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  490. <xsl:apply-templates mode="p5frc:entity.relation.dest" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  491. </xsl:template>
  492. <!--<xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="group" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  493. <xsl:copy>
  494. <xsl:copy-of select="@*"/>
  495. </xsl:copy>
  496. </xsl:template>-->
  497. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="text()|comment()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  498. <xsl:comment>#228-A disabled mode p5dkp.entities-generated:generated.xsd.elements.refs=<xsl:value-of select="name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> ; <xsl:copy-of select="@*" copy-namespaces="no"/></xsl:comment>
  499. </xsl:template>
  500. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  501. <xsl:comment>#228-B disabled mode p5dkp.entities-generated:generated.xsd.elements.refs=<xsl:value-of select="name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> ; <xsl:copy-of select="@*" copy-namespaces="no"/></xsl:comment>
  502. </xsl:template>
  503. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="complexType[ not(parent::schema) ]">
  504. <xsl:comment>#218 not complexType[ not(parent::schema) ] </xsl:comment>
  505. </xsl:template>
  506. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="complexType[ ancestor::complexType]" priority="9">
  507. <xsl:comment>#286 match="complexType[ ancestor::complexType]" disabled loop </xsl:comment>
  508. </xsl:template>
  509. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="*">
  510. <xsl:comment>#219 disabled <xsl:value-of select="name()"/>; <xsl:copy-of select="@*" copy-namespaces="no"/></xsl:comment>
  511. <!--<xsl:apply-templates mode="#current"/>-->
  512. </xsl:template>
  513. <!--<xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="sequence">
  514. <xsl:comment>#223 match="sequence" </xsl:comment>
  515. <xsl:apply-templates mode="#current" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  516. <xsl:for-each-group select="group" group-by="substring-before(@ref,':')" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  517. <xsl:comment>#291 matched</xsl:comment>
  518. <xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd.refs" select="." xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  519. </xsl:for-each-group>
  520. </xsl:template>-->
  521. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="text()|comment()"/>
  522. <xsl:template mode="p5dkp.entities-generated:generated.xsd" match="complexContent" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  523. <xsl:copy>
  524. <xsl:comment>#337 match="complexContent"</xsl:comment>
  525. <xsl:apply-templates mode="#current" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  526. </xsl:copy>
  527. </xsl:template>
  528. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements" match="extension" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  529. <xs:extension base="{$p5dkp-er:prefix.prefix}{../../@name}:{../../@name}">
  530. <xsl:comment>#245-A mode="p5dkp.entities-generated:generated.xsd"</xsl:comment>
  531. <xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd.elements" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  532. </xs:extension>
  533. </xsl:template>
  534. <xsl:template mode="p5dkp.entities-generated:generated.xsd" match="extension" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  535. <xs:extension base="{$p5dkp-er:prefix.prefix}{../../@name}:{../../@name}">
  536. <xsl:comment>#304 mode="p5dkp.entities-generated:generated.xsd"</xsl:comment>
  537. <xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  538. </xs:extension>
  539. </xsl:template>
  540. <xsl:template mode="p5dkp.entities-generated:generated.xsd" match="annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  541. <xsl:copy-of select="."/>
  542. </xsl:template>
  543. <xsl:template mode="p5dkp.entities-generated:generated.xsd" match="text()|comment()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  544. <xsl:comment>#263 ignored for <xsl:value-of select="name()"/> <xsl:copy-of select="@*" copy-namespaces="no"/> <xsl:copy-of select="text()"/><xsl:copy></xsl:copy></xsl:comment>
  545. </xsl:template>
  546. <xsl:template mode="p5dkp.entities-generated:generated.xsd" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  547. <xsl:comment>#263-B ignored for <xsl:value-of select="name()"/> <xsl:copy-of select="@*" copy-namespaces="no"/> <xsl:copy-of select="text()"/><xsl:copy></xsl:copy></xsl:comment>
  548. </xsl:template>
  549. <!--<xsl:template mode="p5dkp.entities-generated:generated.xsd" match="text()" xpath-default-namespace="">
  550. <xsl:comment>#263-B ignored for <xsl:value-of select="name()"/> <xsl:copy-of select="@*" copy-namespaces="no"/> <xsl:copy-of select="text()"/><xsl:copy></xsl:copy></xsl:comment>
  551. </xsl:template>-->
  552. <!--<xsl:template mode="p5dkp.entities-generated:generated.xsd" match="group[@ref]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  553. <xsl:copy>
  554. <xsl:copy-of select="@*"/>
  555. </xsl:copy>
  556. </xsl:template>-->
  557. <!--<xsl:template xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="group" mode="p5dkp.entities-generated:generated.xsd.local">
  558. <xsl:copy>
  559. <xsl:copy-of select="@*"/>
  560. </xsl:copy>
  561. </xsl:template>-->
  562. <!--<xsl:template mode="p5dkp.entities-generated:generated.xsd" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  563. <xsl:comment>#199 ignored mode="p5dkp.entities-generated:generated.xsd" match="*" name=<xsl:value-of select="name()"/> <xsl:copy-of select="@*" copy-namespaces="no"/></xsl:comment>
  564. </xsl:template>-->
  565. <xsl:template mode="p5dkp.entities-generated:generated.xsd" match="import" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  566. <!--<xsl:copy-of select="." copy-namespaces="no"/>-->
  567. <xs:import namespace="{@namespace}">
  568. <xsl:attribute name="schemaLocation" select="p5frc:try.import.fix.schemaLocation.path(@schemaLocation)"/>
  569. </xs:import>
  570. </xsl:template>
  571. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  572. <xsl:copy>
  573. <xsl:copy-of select="@*"/>
  574. <xsl:apply-templates xpath-default-namespace="http://www.w3.org/2001/XMLSchema" mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq"/>
  575. </xsl:copy>
  576. </xsl:template>
  577. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq" match="group[@ref]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  578. <!-- <xsl:copy>
  579. <xsl:copy-of select="@*"/>-->
  580. <xsl:apply-templates mode="#current" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  581. <!--</xsl:copy>-->
  582. </xsl:template>
  583. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq" match="group" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  584. <xsl:copy>
  585. <xsl:copy-of select="@*"/>
  586. <xsl:apply-templates mode="#current" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  587. </xsl:copy>
  588. </xsl:template>
  589. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq" match="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  590. <xsl:copy>
  591. <xsl:copy-of select="@*"/>
  592. <p5dkp.entities-generated:generated.xsd.elements.refs.seq.extra>
  593. <xsl:apply-templates select=".//*" mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq.extra" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  594. </p5dkp.entities-generated:generated.xsd.elements.refs.seq.extra>
  595. </xsl:copy>
  596. </xsl:template>
  597. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq" match="sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  598. <xsl:copy>
  599. <xsl:copy-of select="@*"/>
  600. <xsl:apply-templates mode="#current" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  601. </xsl:copy>
  602. </xsl:template>
  603. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq.extra" match="complexContent|complexContent|extension|simpleContent|simpleType|restriction|system_cache__appinfo:primaryKey|appinfo|annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  604. <xsl:copy>
  605. <xsl:copy-of select="@*"/>
  606. </xsl:copy>
  607. </xsl:template>
  608. <xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs.seq p5dkp.entities-generated:generated.xsd.elements.refs.seq.extra" match="text()|comment()|*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  609. <!--<xsl:template mode="p5dkp.entities-generated:generated.xsd.elements.refs" match="sequence" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  610. <xsl:param name="p5frc:entity.relation.source" required="yes"/>
  611. <xsl:comment>#220 mode="p5dkp.entities-generated:generated.xsd.elements.refs" @id=<xsl:value-of select="@id"/></xsl:comment>
  612. <!-\-<xsl:variable name="group">-\->
  613. <xs:sequence>
  614. <!-\-<xsl:for-each-group select="group" group-by="substring-before(@ref,':')" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">-\->
  615. <!-\-<xsl:comment>#222 matched </xsl:comment>-\->
  616. <!-\-<xsl:variable name="p5frc:target_object" select="@ref"/>-\->
  617. <xsl:choose>
  618. <xsl:when test=".//extension[@base='p5dkp.entities:entities']/complexType/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  619. <xsl:comment>#442 niepotrzebne przetworzenie jest abtract</xsl:comment>
  620. </xsl:when>
  621. <xsl:otherwise>
  622. <p5frc:entity.relation.source>
  623. <xsl:copy-of select="$p5frc:entity.relation.source" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  624. </p5frc:entity.relation.source>
  625. <xsl:for-each select="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  626. <xsl:variable name="p5frc:entity.relation.dest">
  627. <xsl:apply-templates mode="p5frc:entity.relation.dest" select="." xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  628. </xsl:variable>
  629. <xsl:copy-of select="$p5frc:entity.relation.dest"/>
  630. <xsl:call-template name="p5frc:entity.relation.source.analys">
  631. <xsl:with-param name="p5frc:entity.relation.dest" select="$p5frc:entity.relation.dest"/>
  632. <xsl:with-param name="p5frc:entity.relation.source" select="$p5frc:entity.relation.source"/>
  633. </xsl:call-template>
  634. <!-\-<EACH_TEST>
  635. <xsl:attribute name="pos.child" select="position()"/>
  636. <xsl:attribute name="element" select="name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  637. <xsl:attribute name="name" select="concat(@ref,@name)"/>
  638. <xsl:attribute name="depth" select="count(descendant::*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  639. </EACH_TEST>-\->
  640. </xsl:for-each>
  641. </xsl:otherwise>
  642. </xsl:choose>
  643. <!-\-<DEBUG_FIRST_RELS_group>
  644. <xsl:copy-of select="@*"/>
  645. <xsl:attribute name="element" select="name()"/>
  646. <xsl:attribute name="pos_group" select="position()"/>-\->
  647. <!-\-<FOREACH_TEST_must_use_full_group_data>-\->
  648. <!-\-</FOREACH_TEST_must_use_full_group_data>-\->
  649. <!-\-<xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd.refs" select="." xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>-\->
  650. <!-\-</DEBUG_FIRST_RELS_group>-\->
  651. <!-\-</xsl:for-each-group>-\->
  652. </xs:sequence>
  653. <!-\-</xsl:variable>-\->
  654. <!-\-<xsl:apply-templates mode="p5dkp.entities-generated:generated.xsd.elements.refs.group" select="$group"/>-\->
  655. </xsl:template>-->
  656. <xsl:template mode="p5frc:entity.relation.dest" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="group|complexContent"> <!-- [ substring-after(@base,':')='entities' and substring-before(@base,':')=$p5dkp.entities:prefix ]] -->
  657. <p5frc:entity.relation.dest>
  658. <xsl:variable name="p5dkp.entities:dest.prefix" select=" substring-before(@ref,':')"/>
  659. <xsl:attribute name="p5frc:entity.relation.dest.namespace" select="root()/schema/namespace::*[ name() = $p5dkp.entities:dest.prefix]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  660. <xsl:attribute name="p5dkp.entities:prefix" select="$p5dkp.entities:prefix"/>
  661. <xsl:attribute name="p5dkp.entities:entity.prefix" select="$p5dkp.entities:dest.prefix"/>
  662. <xsl:attribute name="element" select="name()"/>
  663. <xsl:attribute name="elements.child" select="*/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  664. <xsl:attribute name="p5frc:entity.relation.dest.group.chilst" select="group/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  665. <xsl:attribute name="p5dkp.entities:entity.childs.count" select="count(.//*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  666. <xsl:attribute name="p5dkp.entities:entities.child.abstract" select=".//extension[@base='p5dkp.entities:entities']/complexType/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> <!-- and complexType[ @abstract='true' ] -->
  667. <attributes><xsl:copy-of select="@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></attributes>
  668. <p5frc:entity.relation.anal.child>
  669. <!--<xsl:for-each select="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  670. <pos>
  671. <xsl:attribute name="pos" select="position()"/>
  672. <xsl:attribute name="count" select="count(.//.)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  673. </pos>
  674. </xsl:for-each>-->
  675. <childs>
  676. <xsl:apply-templates mode="p5frc:entity.relation.go_bottom" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  677. </childs>
  678. </p5frc:entity.relation.anal.child>
  679. </p5frc:entity.relation.dest>
  680. </xsl:template>
  681. <xsl:template mode="p5frc:entity.relation.go_bottom" match="text()|comment()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  682. <xsl:template mode="p5frc:entity.relation.go_bottom" match="documentation|annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  683. <xsl:template mode="p5frc:entity.relation.go_bottom" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  684. <!--<p5frc:entity.relation.go_bottom>
  685. <xsl:copy-of select="@*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  686. <xsl:attribute name="element" select="name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>-->
  687. <xsl:variable name="p5frc:entity.relation.try">
  688. <p5frc:entity.relation.try>
  689. <xsl:for-each select="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  690. <pos>
  691. <xsl:attribute name="pos" select="position()"/>
  692. <xsl:attribute name="count" select="count(.//.)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  693. </pos>
  694. </xsl:for-each>
  695. </p5frc:entity.relation.try>
  696. </xsl:variable>
  697. <xsl:variable name="max.count" select="max($p5frc:entity.relation.try//pos[ not(local-name()='documentation') and not(local-name()='annotation') ]/number(@count))" xpath-default-namespace="" />
  698. <xsl:variable name="max.count.pos" select="$p5frc:entity.relation.try//pos[@count = $max.count]/@pos" xpath-default-namespace=""/>
  699. <xsl:variable name="max.count.pos.count" select="count($p5frc:entity.relation.try//pos[@count = $max.count]/@pos)" xpath-default-namespace=""/>
  700. <!-- <xsl:attribute name="max.count" select="$max.count"/>
  701. <xsl:attribute name="max.count.pos" select="$max.count.pos"/>
  702. <xsl:attribute name="max.count.pos.count" select="$max.count.pos.count"/>
  703. <xsl:copy-of select="$p5frc:entity.relation.try" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>-->
  704. <xsl:choose>
  705. <xsl:when test="$max.count.pos.count = 1 and $max.count &gt; 3">
  706. <xsl:comment>#518-A going to [<xsl:value-of select="$max.count.pos"/>] @id=<xsl:value-of select="@id"/></xsl:comment>
  707. <xsl:apply-templates mode="#current" select="*[$max.count.pos]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  708. </xsl:when>
  709. <xsl:when test="$max.count &lt; 3">
  710. <p5frc:entity.relation.go_bottom>
  711. <xsl:copy-of select="*" copy-namespaces="no" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  712. </p5frc:entity.relation.go_bottom>
  713. </xsl:when>
  714. <xsl:when test="$max.count.pos.count &gt; 1">
  715. <!--<xsl:message terminate="yes">#523 more pos <xsl:copy-of select="$p5frc:entity.relation.try//@*" copy-namespaces="no"/></xsl:message>-->
  716. <xsl:comment>#527-B going to max B @id=<xsl:value-of select="@id"/></xsl:comment>
  717. <xsl:variable name="context" select="." xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  718. <xsl:for-each select="$p5frc:entity.relation.try//pos[@count = $max.count]" xpath-default-namespace="">
  719. <xsl:comment>#527-C going all to max C - <xsl:value-of select="@pos"/>; @id=<xsl:value-of select="@id"/></xsl:comment>
  720. <xsl:apply-templates mode="#current" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" select="$context/*[ current()/@pos ]"/>
  721. </xsl:for-each>
  722. </xsl:when>
  723. <xsl:otherwise>
  724. <p5frc:entity.relation.go_bottom>
  725. <xsl:attribute name="D"/>
  726. <xsl:copy-of select="*" copy-namespaces="no" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  727. </p5frc:entity.relation.go_bottom>
  728. </xsl:otherwise>
  729. </xsl:choose>
  730. <!--</p5frc:entity.relation.go_bottom>-->
  731. </xsl:template>
  732. <xsl:template mode="p5frc:entity.relation.dest" match="annotation" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  733. <xsl:template mode="p5frc:entity.relation.dest" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  734. <xsl:message terminate="no">#439 unatended not match match="group[group]]" <xsl:value-of select="name()"/>; <xsl:copy-of select="@*" copy-namespaces="no"/></xsl:message>
  735. <p5frc:entity.relation.dest_ERROR>
  736. <xsl:attribute name="element" select="name()"/>
  737. <xsl:attribute name="elements.child" select="*/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  738. <attributes><xsl:copy-of select="@*"/></attributes>
  739. <xsl:comment >#439 unatended not match match="group[group]]" <xsl:value-of select="name()"/>; <xsl:copy-of select="@*" copy-namespaces="no"/></xsl:comment>
  740. <childs>
  741. <xsl:apply-templates mode="p5frc:entity.relation.go_bottom" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  742. <!--<xsl:for-each select="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  743. <pos>
  744. <xsl:attribute name="pos" select="position()"/>
  745. <xsl:attribute name="count" select="count(.//.)"/>
  746. <xsl:copy-of select="@*"/>
  747. <xsl:copy-of select="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  748. </pos>
  749. </xsl:for-each>-->
  750. </childs>
  751. </p5frc:entity.relation.dest_ERROR>
  752. </xsl:template>
  753. <xsl:template mode="p5dkp.entities-generated:generated.xsd.refs" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="*">
  754. <xs:element ref="{concat('p5dkp:',p5dkp.entities-generated:entity(@ref))}">
  755. <xsl:apply-templates mode="system_cache__appinfo:flat_relation_cache" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  756. </xs:element>
  757. <xsl:comment>#279 backreffs there</xsl:comment>
  758. <xsl:for-each-group select="root()/schema/complexType/complexContent/extension/sequence/group[substring-before(@ref,':') = current()/substring-before(@ref,':')]" group-by="ancestor::complexType[1]/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  759. <xsl:message>#281 backref found = <xsl:value-of select="ancestor::complexType[1]/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
  760. <xsl:comment>#281 backref found = <xsl:value-of select="ancestor::complexType[1]/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:comment>
  761. <!--<DEBUG>
  762. <xsl:attribute name="looking" select="ancestor::complexType[1]/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>-->
  763. <xs:element>
  764. <xsl:attribute name="ref" select="concat('p5dkp:',ancestor::complexType[1]/@name)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  765. <xsl:apply-templates mode="system_cache__appinfo:flat_relation_cache" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  766. </xs:element>
  767. <!--</DEBUG>-->
  768. </xsl:for-each-group>
  769. </xsl:template>
  770. <xsl:template mode="system_cache__appinfo:flat_relation_cache" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  771. <!--<xsl:comment> #294 todo mode="system_cache__appinfo:flat_relation_cache" szukamy</xsl:comment>-->
  772. <system_cache__appinfo:flat_relation_cache>
  773. <xsl:for-each select="*">
  774. <TEST pos="{position()}">
  775. <xsl:for-each select=".//*">
  776. <xsl:if test="position() = last()">
  777. <xsl:copy-of select="."/>
  778. </xsl:if>
  779. </xsl:for-each>
  780. </TEST>
  781. </xsl:for-each>
  782. <!--<xsl:apply-templates mode="#current"/>-->
  783. </system_cache__appinfo:flat_relation_cache>
  784. </xsl:template>
  785. </xsl:stylesheet>