object_modeling.xsl 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  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. xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  5. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  6. xmlns:p5="https://biuro.biall-net.pl/wfs"
  7. xmlns:p5om="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/object_modeling/object_modeling.xsd"
  8. exclude-result-prefixes="xs"
  9. version="2.0">
  10. <xsl:output indent="yes"/>
  11. <xsl:strip-space elements="*"/>
  12. <!-- TEN TEMPLATE NIE JEST DO ROBIENIA STRUKTURY LACZONEJ - UZYJ object_modeling_by_xml_schema.xsl -->
  13. <!--<xsl:include href="get_all_xsd.xsl"/>-->
  14. <!--<xsl:param name="procesy5_system_schema_file" select="'../default_db.instance.xml/transformed/procesy5_system_schema.xml'"/>-->
  15. <xsl:include href="system_cache__appinfo/TargetNamespaceBindings.xsl"/>
  16. <!--<xsl:include href="get_all_xsd.xsl"/>--> <!-- for use system_cache__appinfo:escape_object_prefix_to_string -->
  17. <xsl:include href="system_cache__appinfo/vrtfNamespaces.xsl"/>
  18. <xsl:param name="prototype_object_namespace" select="'https://biuro.biall-net.pl/wfs/default_db/Types/Empty.xsd'"/>
  19. <xsl:param name="new_object_namespace"/> <!-- example https://biuro.biall-net.pl/wfs/default_db/table/CRM_PROCES.xsd -->
  20. <xsl:param name="targetNamespace.base" required="yes"/> <!-- usually biuro.biall-net.pl/xmlschema_procesy5/default_db -->
  21. <xsl:param name="object_modeling.Error.Handling" required="yes"/>
  22. <xsl:param name="NamespaceObjectInstanceTable" required="yes"/>
  23. <xsl:param name="merge_priority" select="'database'"/> <!-- for default_db or prototype -->
  24. <!--<xsl:param name="new_object.name" required="yes"/>--> <!-- Musi byc name = np ACCESS_REQUESTS -->
  25. <!--<xsl:param name="targetNamespace_DEFAULTS" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db'"/>-->
  26. <!--<xsl:param name="procesy5_system_schema_collection_dir" select="'../../'"/>--> <!-- should be like /Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html -->
  27. <xsl:param name="suppres_saving" /><!-- select="'suppres_saving'" to temporary disable output save -->
  28. <xsl:template name="system_cache__appinfo:check_if_schema_element_exists_by_base">
  29. <xsl:param name="base"/>
  30. <xsl:param name="prototype"/>
  31. <xsl:for-each select="$base">
  32. <xsl:choose>
  33. <xsl:when test="$prototype[ not(@name=current()/@name) and not(name()=current()/name())]">
  34. <xsl:copy-of select="."/>
  35. <!--<xsl:element name="{name()}">
  36. <xsl:copy-of select="@*"/>
  37. <xsl:call-template name="system_cache__appinfo:check_if_schema_element_exists_by_base">
  38. <xsl:with-param name="base" select=""/>
  39. <xsl:with-param name="prototype"/>
  40. </xsl:call-template>
  41. </xsl:element>-->
  42. </xsl:when>
  43. </xsl:choose>
  44. </xsl:for-each>
  45. </xsl:template>
  46. <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:new_object_by_prototype">
  47. <xsl:message>#72 system_cache__appinfo:new_object_by_prototype with param testing:
  48. $targetNamespace.base = <xsl:value-of select="$targetNamespace.base"/>
  49. $new_object_namespace = <xsl:value-of select="$new_object_namespace"/>
  50. $prototype_object_namespace = <xsl:value-of select="$prototype_object_namespace"/>
  51. searching for @targetNamespace = <xsl:value-of select="substring-after($targetNamespace.base,'://')"/> ($targetNamespace.base) for $NamespaceObjectInstanceTable=<xsl:value-of select="$NamespaceObjectInstanceTable"/>;
  52. </xsl:message>
  53. <xsl:variable name="system_cache__appinfo:new_object_by_prototype.base" select="(system_cache__appinfo:get_all_xsd_default_db|system_cache__appinfo:get_all_xsd)/schema[ substring-after(@targetNamespace,'://')=substring-after($targetNamespace.base,'://')]/complexType[@name=$NamespaceObjectInstanceTable]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  54. <xsl:if test="not($system_cache__appinfo:new_object_by_prototype.base/*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><xsl:message terminate="yes">#25 unknow source object - not found for system_cache__appinfo:get_all_xsd_default_db/schema[@targetNamespace=<xsl:value-of select="$targetNamespace.base"/>]/complexType[@name=<xsl:value-of select="$NamespaceObjectInstanceTable"/>]</xsl:message></xsl:if>
  55. <xsl:message>#26-A count($system_cache__appinfo:new_object_by_prototype.base//*) = <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base//*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> @id <xsl:value-of select="$system_cache__appinfo:new_object_by_prototype.base/@id" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
  56. <!--<debug.45><xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></debug.45>-->
  57. <xsl:variable name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="(system_cache__appinfo:get_all_xsd_default_db|system_cache__appinfo:get_all_xsd)/schema[ substring-after(@targetNamespace,'://')=substring-after($targetNamespace.base,'://')]/simpleType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  58. <xsl:message>#26-B count($system_cache__appinfo:new_object_by_prototype.base.simpleType//*) = <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base.simpleType/*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
  59. <xsl:variable name="system_cache__appinfo:new_object_by_prototype.base.import" select="(system_cache__appinfo:get_all_xsd_default_db|system_cache__appinfo:get_all_xsd)/schema[ substring-after(@targetNamespace,'://')=substring-after($targetNamespace.base,'://')]/import" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  60. <xsl:message>#26-C count($system_cache__appinfo:new_object_by_prototype.base.import) = <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base.import)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
  61. <xsl:if test="string-length($suppres_saving) &gt; 0 ">
  62. <system_cache__appinfo:new_object_by_prototype.base__debug>
  63. <xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base"/>
  64. </system_cache__appinfo:new_object_by_prototype.base__debug>
  65. <system_cache__appinfo:new_object_by_prototype.base.import__debug>
  66. <xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base.import"/>
  67. </system_cache__appinfo:new_object_by_prototype.base.import__debug>
  68. </xsl:if>
  69. <xsl:choose>
  70. <xsl:when test="$prototype_object_namespace and $new_object_namespace">
  71. <xsl:message>#55 when test="$prototype_object_namespace(<xsl:value-of select="$prototype_object_namespace"/>) and $new_object_namespace(<xsl:value-of select="$new_object_namespace"/>)"</xsl:message>
  72. <xsl:variable name="system_cache__appinfo:new_object_by_prototype_test_if_prototype">
  73. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype">
  74. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  75. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
  76. </xsl:apply-templates>
  77. </xsl:variable>
  78. <xsl:message>#61 count($system_cache__appinfo:new_object_by_prototype_test_if_prototype/*) = <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype_test_if_prototype/*)" /></xsl:message>
  79. <xsl:choose>
  80. <xsl:when test="$system_cache__appinfo:new_object_by_prototype_test_if_prototype/*">
  81. <!--<xsl:variable name="system_cache__appinfo:new_object_by_prototype.base" select="(system_cache__appinfo:get_all_xsd_default_db/schema[ substring-after(@targetNamespace,'://')=substring-after($targetNamespace.base,'://')]/complexType[@name=$NamespaceObjectInstanceTable]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>-->
  82. <xsl:message>#65 $system_cache__appinfo:new_object_by_prototype.base is in schema - OK applying</xsl:message>
  83. <!-- podciagniecie brakujacych simpleschema -->
  84. <xsl:message>#72 count system_cache__appinfo:new_object_by_prototype.base.simpleType= <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base.simpleType/*)"/></xsl:message>
  85. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype">
  86. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  87. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
  88. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.import" select="$system_cache__appinfo:new_object_by_prototype.base.import"/>
  89. </xsl:apply-templates>
  90. </xsl:when>
  91. <xsl:otherwise>
  92. <xsl:message terminate="no">#32 prototype <xsl:value-of select="$prototype_object_namespace"/> not exists in schema ! if it realy exiss consider rebuild procesy5_system_schema.xml !</xsl:message>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </xsl:when>
  96. <xsl:otherwise><xsl:message terminate="no">#25 not set required $prototype_object_namespace and $new_object_namespace params!</xsl:message></xsl:otherwise>
  97. </xsl:choose>
  98. </xsl:template>
  99. <xsl:template mode="system_cache__appinfo:new_object_by_prototype" match="system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_default_db">
  100. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  101. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/>
  102. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.import" required="yes"/>
  103. <!--<xsl:comment>#82 matched system_cache__appinfo:get_all_xsd <xsl:value-of select="schema/@targetNamespace" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> / <xsl:value-of select="schema/*[@id][1]/@id" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:comment>-->
  104. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype">
  105. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  106. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
  107. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.import" select="$system_cache__appinfo:new_object_by_prototype.base.import"/>
  108. </xsl:apply-templates>
  109. </xsl:template>
  110. <xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="system_cache__appinfo:get_all_xsd|system_cache__appinfo:get_all_xsd_default_db">
  111. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype"/>
  112. </xsl:template>
  113. <xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="schema[@targetNamespace=$prototype_object_namespace]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  114. <system_cache__appinfo:new_object_by_prototype_test_if_prototype>exists_flag</system_cache__appinfo:new_object_by_prototype_test_if_prototype>
  115. </xsl:template>
  116. <xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="*|text()|comment()"/>
  117. <xsl:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="text()|comment()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  118. <xsl:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  119. <!-- add needed simpleType from prototype -->
  120. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  121. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/><!-- this is complexType -->
  122. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  123. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  124. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  125. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes" />
  126. <xsl:message>#118 matched schema mode system_cache__appinfo:new_object_by_prototype.base.simpleType </xsl:message>
  127. <xsl:variable name="base.simpleSchema.to.unique">
  128. <xsl:variable name="current" select="."/>
  129. <xsl:for-each select="$system_cache__appinfo:new_object_by_prototype.base//element[@type]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  130. <xsl:variable name="current.base" select="."/>
  131. <xsl:for-each-group select="$current//element[@type]" group-by="@type" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  132. <xsl:choose>
  133. <xsl:when test="$current.base/@name = current()/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  134. <xsl:message>#143 detected @name=<xsl:value-of select="$current.base/@name"/>; @type=<xsl:value-of select="$current.base/@type"/>; bypassing</xsl:message>
  135. <!--<xsl:comment>#143 detected @name=<xsl:value-of select="$current.base/@name"/>; @type=<xsl:value-of select="$current.base/@type"/>; bypassing</xsl:comment>-->
  136. </xsl:when>
  137. <xsl:otherwise>
  138. <xsl:message>#146 NOT detected name()=<xsl:value-of select="$current.base/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>; @name=<xsl:value-of select="$current.base/@name"/>; @type=<xsl:value-of select="$current.base/@type" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> simpleTYpe for @type=<xsl:value-of select="$current.base/@type"/></xsl:message>
  139. <xsl:comment>#146 NOT detected name()=<xsl:value-of select="$current.base/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>; @name=<xsl:value-of select="$current.base/@name"/>; @type=<xsl:value-of select="$current.base/@type" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/> simpleTYpe for @type=<xsl:value-of select="$current.base/@type"/></xsl:comment>
  140. <!--<xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base.simpleType//simpleType[@name = system_cache__appinfo:clean_object_prefix(@type) ]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>-->
  141. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_root" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType[@name=$current.base/system_cache__appinfo:clean_object_prefix(@type)]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  142. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  143. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  144. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  145. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  146. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  147. </xsl:apply-templates>
  148. </xsl:otherwise>
  149. </xsl:choose>
  150. </xsl:for-each-group>
  151. </xsl:for-each>
  152. </xsl:variable>
  153. <xsl:for-each-group select="$base.simpleSchema.to.unique/simpleType" group-by="@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  154. <xsl:copy-of select="."/>
  155. </xsl:for-each-group>
  156. </xsl:template>
  157. <xsl:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  158. <!-- add needed simpleType from prototype -->
  159. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  160. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/><!-- this is complexType -->
  161. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype.base.simpleType">
  162. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  163. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
  164. </xsl:apply-templates>
  165. </xsl:template>
  166. <xsl:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  167. <!-- add needed simpleType from prototype -->
  168. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  169. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/><!-- this is complexType -->
  170. <xsl:message>#115 matched sequence/ </xsl:message>
  171. <xsl:comment>#115 matched sequence/ </xsl:comment>
  172. <xsl:variable name="current" select="current()"/>
  173. <!--<xsl:for-each select="$system_cache__appinfo:new_object_by_prototype.base//element[@type]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"> <!-\- if priority is for prototype TODO -\->-->
  174. <!-- najpierw sprawdzamy czy element juz nie byl, priorytet ma @typ z prototypu? todo -->
  175. <xsl:choose>
  176. <xsl:when test="$current/@name = current()/@name">
  177. <xsl:message>#143 detected @name=<xsl:value-of select="@name"/>; element/@type=<xsl:value-of select="@type"/>; bypassing</xsl:message>
  178. <xsl:comment>
  179. #143 detected <xsl:value-of select="@name"/> element, bypassing
  180. </xsl:comment>
  181. </xsl:when>
  182. <xsl:otherwise>
  183. <xsl:message>#146 NOT detected <xsl:value-of select="@name"/> element, trying to add @type=<xsl:value-of select="@type"/> simpleTYpe for @type=<xsl:value-of select="@type"/></xsl:message>
  184. <xsl:comment>
  185. #146 NOT detected <xsl:value-of select="@name"/> element, trying to add @type simpleTYpe for @type=<xsl:value-of select="@type"/>, found <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base.simpleType//simpleType[@name = system_cache__appinfo:clean_object_prefix(@type) ])"/>
  186. </xsl:comment>
  187. <!--<xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base.simpleType//simpleType[@name = system_cache__appinfo:clean_object_prefix(@type) ]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>-->
  188. <xsl:value-of select="$system_cache__appinfo:new_object_by_prototype.base.simpleType/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  189. </xsl:otherwise>
  190. </xsl:choose>
  191. <!-- </xsl:for-each>-->
  192. </xsl:template>
  193. <xsl:template mode="system_cache__appinfo:new_object_by_prototype" match="schema[@targetNamespace=$prototype_object_namespace]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  194. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/> <!-- this is complexType -->
  195. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/>
  196. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.import" required="yes"/>
  197. <xsl:variable name="prototype_TargetNamespaceBindings_from_Namespace">
  198. <xsl:call-template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
  199. <xsl:with-param name="TargetNamespace" select="$prototype_object_namespace"/>
  200. <!--<xsl:with-param name="NamespaceObjectInstanceTable" select="$NamespaceObjectInstanceTable"/>-->
  201. </xsl:call-template>
  202. </xsl:variable>
  203. <xsl:message>#232 again count($system_cache__appinfo:new_object_by_prototype.base//*) = <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base//*)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
  204. <xsl:message>
  205. count($system_cache__appinfo:new_object_by_prototype.base) = <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base//*)"/>
  206. #208-A result $prototype_TargetNamespaceBindings_from_Namespace from param/$TargetNamespace<xsl:value-of select="$prototype_object_namespace"/>;
  207. /@NamespaceDatabaseStorageDefinitionPrefix=<xsl:value-of select="$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix"/>;
  208. /@NamespaceObjectInstanceType=<xsl:value-of select="$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType"/>;
  209. /@NamespaceObjectInstanceTable=<xsl:value-of select="$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable"/>;
  210. /@NamespacePrefix=<xsl:value-of select="$prototype_TargetNamespaceBindings_from_Namespace//@NamespacePrefix"/>;</xsl:message>
  211. <xsl:variable name="targetNamespace.base.TargetNamespaceBindings_from_Namespace">
  212. <xsl:call-template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
  213. <xsl:with-param name="TargetNamespace" select="$targetNamespace.base"/>
  214. <xsl:with-param name="NamespaceObjectInstanceTable" select="$NamespaceObjectInstanceTable"/>
  215. </xsl:call-template>
  216. </xsl:variable>
  217. <xsl:message>#208-B result $targetNamespace.base.TargetNamespaceBindings_from_Namespace from param/$targetNamespace.base<xsl:value-of select="$targetNamespace.base"/>; (this is from we use object to merge e.g. https://biuro.biall-net.pl/api/36
  218. /@NamespaceDatabaseStorageDefinitionPrefix=<xsl:value-of select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix"/>;
  219. /@NamespaceObjectInstanceType=<xsl:value-of select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType"/>;
  220. /@NamespaceObjectInstanceTable=<xsl:value-of select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable"/>;
  221. /@NamespacePrefix=<xsl:value-of select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace//@NamespacePrefix"/>;</xsl:message>
  222. <xsl:variable name="new_TargetNamespaceBindings_from_Namespace">
  223. <xsl:call-template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
  224. <xsl:with-param name="TargetNamespace" select="$new_object_namespace"/>
  225. </xsl:call-template>
  226. </xsl:variable>
  227. <xsl:variable name="prototype_NamespacePrefix">
  228. <xsl:for-each select="namespace::node()">
  229. <xsl:if test=".= $prototype_object_namespace">
  230. <xsl:value-of select="name()"/>
  231. </xsl:if>
  232. </xsl:for-each>
  233. </xsl:variable>
  234. <system_cache__appinfo:new_object_by_prototype>
  235. <xsl:attribute name="prototype_object_namespace" select="$prototype_object_namespace"/>
  236. <xsl:attribute name="new_object_namespace" select="$new_object_namespace"/>
  237. <xsl:attribute name="generating_schema_file_to" select="concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd')"/>
  238. <prototype_TargetNamespaceBindings_from_Namespace>
  239. <xsl:copy-of select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  240. </prototype_TargetNamespaceBindings_from_Namespace>
  241. <new_TargetNamespaceBindings_from_Namespace>
  242. <xsl:copy-of select="$new_TargetNamespaceBindings_from_Namespace"/>
  243. </new_TargetNamespaceBindings_from_Namespace>
  244. <targetNamespace.base.TargetNamespaceBindings_from_Namespace>
  245. <xsl:copy-of select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  246. </targetNamespace.base.TargetNamespaceBindings_from_Namespace>
  247. <prototype_NamespacePrefix>
  248. <xsl:copy-of select="$prototype_NamespacePrefix"/>
  249. </prototype_NamespacePrefix>
  250. <xsl:choose>
  251. <xsl:when test="$object_modeling.Error.Handling='IGNORE' and doc-available(concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd'))">
  252. <xsl:message>#235 ERROR document already generated and aviable
  253. </xsl:message>
  254. <ERROR>
  255. <xsl:attribute name="message" select="concat('document already generated and aviable at ',$procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd')"/>
  256. OUTPUT__START
  257. document already generated and aviable
  258. OUTPUT__END
  259. </ERROR>
  260. </xsl:when>
  261. <xsl:otherwise>
  262. <xsl:variable name="result_document">
  263. <xsl:message>#139 will try saving to <xsl:value-of select="concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd')"/></xsl:message>
  264. <!--<xsl:attribute name="href" select=" concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd')"/>-->
  265. <xsl:element name="xs:schema">
  266. <xsl:copy-of select="namespace::node()"/>
  267. <xsl:namespace name="{$new_TargetNamespaceBindings_from_Namespace//@NamespacePrefix}" select="$new_object_namespace"/>
  268. <xsl:attribute name="targetNamespace" select="$new_object_namespace"/>
  269. <xsl:if test="$vc:minVersion"><xsl:attribute name="vc:minVersion" select="$vc:minVersion"/></xsl:if>
  270. <xsl:if test="$vc:maxVersion"><xsl:attribute name="vc:maxVersion" select="$vc:maxVersion"/></xsl:if>
  271. <xsl:variable name="system_cache__appinfo:new_object_by_prototype_schema_root">
  272. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_root">
  273. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  274. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  275. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  276. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  277. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.import" select="$system_cache__appinfo:new_object_by_prototype.base.import"/>
  278. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  279. </xsl:apply-templates>
  280. </xsl:variable>
  281. <xsl:for-each-group select="$system_cache__appinfo:new_object_by_prototype_schema_root//@ref" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" group-by="substring-before(.,':')">
  282. <xsl:variable name="targetNamespace" select=" system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_object_prefix(.))"/>
  283. <xsl:choose>
  284. <xsl:when test=" string-length($targetNamespace) &gt; 0">
  285. <xsl:namespace name="{ system_cache__appinfo:get_object_prefix(.)}" select="$targetNamespace"/>
  286. </xsl:when>
  287. </xsl:choose>
  288. </xsl:for-each-group>
  289. <!-- namespaces from referenced TODO za pierwszym razem nie bedzie znanych namespace dla tych obiektow - trzeba bedzie je drugi raz przejechac -->
  290. <xsl:for-each-group select="$system_cache__appinfo:new_object_by_prototype_schema_root//@ref" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" group-by="substring-before(.,':')">
  291. <xsl:variable name="targetNamespace" select=" system_cache__appinfo:targetNamespace_from_prefix($system_cache__appinfo:vrtfNamespaces, system_cache__appinfo:get_object_prefix(.))"/>
  292. <xsl:choose>
  293. <xsl:when test=" string-length($targetNamespace) &gt; 0">
  294. <xsl:choose>
  295. <xsl:when test="$targetNamespace = $targetNamespace.base"/><!-- not import self -->
  296. <xsl:when test="$targetNamespace = $system_cache__appinfo:new_object_by_prototype.base.import//@namespace"></xsl:when>
  297. <xsl:when test="$prototype_object_namespace = $targetNamespace"/>
  298. <xsl:when test="string-length(system_cache__appinfo:get_default_db_obj_url_schema($targetNamespace)) = 0"></xsl:when>
  299. <xsl:otherwise>
  300. <xsl:comment>#334 $prototype_object_namespace = </xsl:comment>
  301. <xs:import xsl:exclude-result-prefixes="p5om p5">
  302. <xsl:attribute name="namespace" select="$targetNamespace"/>
  303. <xsl:attribute name="schemaLocation" select="system_cache__appinfo:get_default_db_obj_url_schema($targetNamespace)"/>
  304. </xs:import>
  305. </xsl:otherwise>
  306. </xsl:choose>
  307. </xsl:when>
  308. <xsl:otherwise>
  309. <xsl:message>#TODO 343 not detected targetnamespace for <xsl:value-of select="."/></xsl:message>
  310. <xsl:comment>#TODO 343 not detected targetnamespace for <xsl:value-of select="."/></xsl:comment>
  311. </xsl:otherwise>
  312. </xsl:choose>
  313. </xsl:for-each-group>
  314. <xsl:for-each select="$system_cache__appinfo:new_object_by_prototype.base.import/*">
  315. <xsl:choose>
  316. <xsl:when test="@namespace = $targetNamespace.base"/><!-- not self import schema -->
  317. <xsl:otherwise>
  318. <xsl:copy-of select="."/>
  319. </xsl:otherwise>
  320. </xsl:choose>
  321. </xsl:for-each>
  322. <xsl:variable name="system_cache__appinfo:check_if_schema_element_exists_by_base" >
  323. <xsl:call-template name="system_cache__appinfo:check_if_schema_element_exists_by_base">
  324. <xsl:with-param name="base" select="$system_cache__appinfo:new_object_by_prototype.base/*"/>
  325. <xsl:with-param name="prototype" select="*"/>
  326. </xsl:call-template>
  327. </xsl:variable>
  328. <xsl:comment>#336 import upper</xsl:comment>
  329. <xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype_schema_root"/>
  330. <xsl:if test=" string-length($suppres_saving) &gt; 0">
  331. <debug.287.schema_input_for_apply_template>
  332. <xsl:attribute name="prototype_object_namespace" select="$prototype_object_namespace"/>
  333. <xsl:copy-of select="."/>
  334. </debug.287.schema_input_for_apply_template>
  335. <debug.143>
  336. <xsl:attribute name="base" select="$system_cache__appinfo:new_object_by_prototype.base/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" />
  337. <xsl:attribute name="prototype" select="name()"/>
  338. <xsl:copy-of select="$system_cache__appinfo:check_if_schema_element_exists_by_base"/>
  339. </debug.143>
  340. <debug.273>
  341. <system_cache__appinfo:new_object_by_prototype.base>
  342. <xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base"/>
  343. </system_cache__appinfo:new_object_by_prototype.base>
  344. </debug.273>
  345. </xsl:if>
  346. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="." >
  347. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.import" select="$system_cache__appinfo:new_object_by_prototype.base.import"/>
  348. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
  349. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  350. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  351. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  352. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  353. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  354. </xsl:apply-templates>
  355. </xsl:element>
  356. </xsl:variable>
  357. <xsl:choose>
  358. <xsl:when test=" string-length($suppres_saving) &gt; 0">
  359. <xsl:message>#290 DEBUG $suppres_saving was suppressed by <xsl:value-of select="$suppres_saving"/> param ; </xsl:message>
  360. <xsl:copy-of select="$result_document"/>
  361. </xsl:when>
  362. <xsl:otherwise>
  363. <xsl:message>#348 doing save result-document now! </xsl:message>
  364. <xsl:result-document href="{ concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd')}">
  365. <xsl:copy-of select="$result_document"/>
  366. </xsl:result-document>
  367. </xsl:otherwise>
  368. </xsl:choose>
  369. </xsl:otherwise>
  370. </xsl:choose>
  371. </system_cache__appinfo:new_object_by_prototype>
  372. </xsl:template>
  373. <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="import" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  374. <xsl:message>#346 mached import <xsl:value-of select="@namespace"/> <xsl:value-of select="@schemaLocation"/></xsl:message>
  375. <xsl:copy-of select="."/>
  376. </xsl:template>
  377. <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  378. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  379. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  380. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  381. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  382. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  383. <xsl:element name="{name()}">
  384. <xsl:message>#145 debug name form prototype is <xsl:value-of select="$system_cache__appinfo:new_object_by_prototype.base/name()"/>//<xsl:value-of select="*/name()"/></xsl:message>
  385. <xsl:if test="$suppres_saving"><xsl:attribute name="debug.350">#350 created there having childs */name() <xsl:value-of select="*/name()"/></xsl:attribute></xsl:if>
  386. <xsl:apply-templates select="@*" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
  387. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  388. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  389. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  390. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  391. </xsl:apply-templates>
  392. <!--<xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,8),'_', substring(replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable),0,5),'_',generate-id())"/>-->
  393. <!--<xsl:attribute name="name" select=" replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'InfrastructureAAAA')"/>-->
  394. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  395. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  396. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  397. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  398. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  399. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  400. </xsl:apply-templates>
  401. </xsl:element>
  402. </xsl:template>
  403. <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="element|simpleType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  404. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  405. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  406. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  407. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  408. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  409. <xsl:element name="{name()}">
  410. <xsl:message>#145 debug name form prototype is <xsl:value-of select="$system_cache__appinfo:new_object_by_prototype.base/name()"/>//<xsl:value-of select="*/name()"/></xsl:message>
  411. <xsl:apply-templates select="@*" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
  412. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  413. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  414. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  415. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  416. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  417. </xsl:apply-templates>
  418. <!--<xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,8),'_', substring(replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable),0,5),'_',generate-id())"/>-->
  419. <!--<xsl:attribute name="name" select=" replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'InfrastructureAAAA')"/>-->
  420. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  421. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  422. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  423. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  424. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  425. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  426. </xsl:apply-templates>
  427. </xsl:element>
  428. </xsl:template>
  429. <!--<xsl:template match="assert" mode="system_cache__appinfo:new_object_by_prototype_schema_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  430. <xsl:element name="{name()}">
  431. <xsl:copy-of select="@test"/>
  432. </xsl:element>
  433. </xsl:template>-->
  434. <xsl:template match="sequence|choice|all" mode="system_cache__appinfo:new_object_by_prototype_schema_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  435. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  436. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  437. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  438. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  439. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  440. <xsl:message>#200 matched <xsl:value-of select="name()"/>//<xsl:value-of select="*/name()"/></xsl:message>
  441. <xsl:element name="{name()}">
  442. <xsl:if test="$suppres_saving"><xsl:attribute name="debug.410">#410 created there having childs */name() <xsl:value-of select="*/name()"/></xsl:attribute></xsl:if>
  443. <xsl:if test="$suppres_saving"><xsl:attribute name="debug.435">#435 created there having childs from $system_cache__appinfo:new_object_by_prototype.base/sequence/element <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:attribute></xsl:if>
  444. <!--<xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,15),'_',generate-id())"/>-->
  445. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  446. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  447. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  448. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  449. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  450. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  451. </xsl:apply-templates>
  452. <xsl:variable name="current" select="."/>
  453. <xsl:message>#269 testing merge sequence - should be sequence=sequence=<xsl:value-of select="$system_cache__appinfo:new_object_by_prototype.base/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
  454. <xsl:for-each-group select="$system_cache__appinfo:new_object_by_prototype.base/sequence/element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" group-by="concat(@ref,@name)">
  455. <xsl:choose>
  456. <xsl:when test="@name">
  457. <xsl:choose>
  458. <xsl:when test="$current/element[@name = current()/@name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  459. <xsl:message>#272 found ignored <xsl:value-of select="@name"/></xsl:message>
  460. <xsl:comment>#272 found ignored <xsl:value-of select="@name"/></xsl:comment>
  461. </xsl:when>
  462. <xsl:otherwise>
  463. <xsl:comment>#272-A found adding <xsl:value-of select="@name"/>, $prototype_NamespacePrefix = <xsl:value-of select="$prototype_NamespacePrefix"/></xsl:comment>
  464. <xsl:element name="{name()}">
  465. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child" select="@*">
  466. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  467. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  468. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  469. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  470. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  471. <xsl:with-param name="node" select="."/>
  472. </xsl:apply-templates>
  473. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  474. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  475. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  476. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  477. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  478. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  479. <xsl:with-param name="node" select="."/>
  480. </xsl:apply-templates>
  481. </xsl:element>
  482. </xsl:otherwise>
  483. </xsl:choose>
  484. </xsl:when>
  485. <xsl:when test="@ref">
  486. <xsl:message terminate="no">#288 unsupported yet @ref <xsl:value-of select="@ref"/></xsl:message>
  487. <xsl:comment>#288 unsupported yet @ref <xsl:value-of select="@ref"/></xsl:comment>
  488. <xsl:choose>
  489. <xsl:when test="$current/element[@ref = current()/@ref]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  490. <xsl:message>#410 found ignored <xsl:value-of select="@ref"/></xsl:message>
  491. <xsl:comment>#410 found ignored <xsl:value-of select="@ref"/></xsl:comment>
  492. </xsl:when>
  493. <xsl:when test="$current/element//system_cache__appinfo:source[@system_cache__appinfo:name = current()//system_cache__appinfo:source/@system_cache__appinfo:name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  494. <xsl:message>#453 found ignored <xsl:value-of select="@ref"/> by same @system_cache__appinfo:name</xsl:message>
  495. <xsl:comment>#453 found ignored <xsl:value-of select="@ref"/> by same @system_cache__appinfo:name</xsl:comment>
  496. </xsl:when>
  497. <xsl:otherwise>
  498. <xsl:comment>#414-A found adding <xsl:value-of select="@ref"/>, $prototype_NamespacePrefix = <xsl:value-of select="$prototype_NamespacePrefix"/></xsl:comment>
  499. <xsl:element name="{name()}">
  500. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child" select="@*">
  501. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  502. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  503. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  504. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  505. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  506. <xsl:with-param name="node" select="."/>
  507. </xsl:apply-templates>
  508. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  509. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  510. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  511. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  512. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  513. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  514. <xsl:with-param name="node" select="."/>
  515. </xsl:apply-templates>
  516. </xsl:element>
  517. </xsl:otherwise>
  518. </xsl:choose>
  519. </xsl:when>
  520. </xsl:choose>
  521. </xsl:for-each-group>
  522. </xsl:element>
  523. </xsl:template>
  524. <xsl:template match="simpleType[ restriction[@base] and not(*/*)]" mode="system_cache__appinfo:new_object_by_prototype_schema_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  525. <xsl:attribute name="type" select="restriction/@base" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
  526. </xsl:template>
  527. <xsl:template match="attribute|element|assert|complexContent|restriction|enumeration|minInclusive" mode="system_cache__appinfo:new_object_by_prototype_schema_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"> <!-- element| -->
  528. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  529. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  530. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  531. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  532. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  533. <xsl:message>#215 (TODO check if newer from prototype) matched <xsl:value-of select="name()"/>/<xsl:value-of select="@name"/>//<xsl:value-of select="*/name()"/></xsl:message>
  534. <xsl:element name="{name()}">
  535. <xsl:if test="$suppres_saving"><xsl:attribute name="debug.505">#505 @id=<xsl:value-of select="@id"/>; created there having childs */name() <xsl:value-of select="*/name()"/></xsl:attribute></xsl:if>
  536. <xsl:copy-of select="@minOccurs"/>
  537. <xsl:copy-of select="@maxOccurs"/>
  538. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child" select="@*">
  539. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  540. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  541. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  542. <xsl:with-param name="node" select="."/>
  543. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  544. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  545. </xsl:apply-templates>
  546. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  547. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  548. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  549. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  550. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  551. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  552. </xsl:apply-templates>
  553. </xsl:element>
  554. </xsl:template>
  555. <xsl:template match="annotation|appinfo|documentation" mode="system_cache__appinfo:new_object_by_prototype_schema_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
  556. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  557. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  558. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  559. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  560. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  561. <xsl:element name="{name()}">
  562. <xsl:copy-of select="@*"/>
  563. <xsl:copy-of select="text()"/>
  564. <xsl:copy-of select="system_cache__appinfo:base_type"/>
  565. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  566. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  567. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  568. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  569. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  570. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  571. </xsl:apply-templates>
  572. </xsl:element>
  573. </xsl:template>
  574. <xsl:template match="system_cache__appinfo:flat_relation_cache" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  575. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  576. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  577. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  578. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  579. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  580. <xsl:element name="{name()}">
  581. <xsl:copy-of select="@*"/>
  582. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  583. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  584. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  585. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  586. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  587. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  588. </xsl:apply-templates>
  589. </xsl:element>
  590. </xsl:template>
  591. <xsl:template match="system_cache__appinfo:source" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  592. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  593. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  594. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  595. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  596. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  597. <xsl:element name="{name()}">
  598. <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child" select="@*">
  599. <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
  600. <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
  601. <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
  602. <xsl:with-param name="node" select="."/>
  603. <xsl:with-param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" select="$targetNamespace.base.TargetNamespaceBindings_from_Namespace"/>
  604. <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
  605. </xsl:apply-templates>
  606. </xsl:element>
  607. </xsl:template>
  608. <!--<xsl:function name="p5om:remote_object_translate">
  609. <xsl:param name="ref"/> <!-\- ref="p5_zasob_36:IN7_DZIENNIK_KORESP" -\->
  610. <xsl:param name="NamespaceDatabaseStorageDefinitionPrefix.prot"/> <!-\- targetNamespace.base.TargetNamespaceBindings_from_Namespace/@NamespaceDatabaseStorageDefinitionPrefix="p5_zasob_36" -\->
  611. <xsl:param name="NamespaceDatabaseStorageDefinitionPrefix.dest"/> <!-\- new_TargetNamespaceBindings_from_Namespace/@NamespaceDatabaseStorageDefinitionPrefix= default_db -\->
  612. <xsl:variable name="ref_obj_tbl" select=" system_cache__appinfo:clean_object_prefix($ref)"/>
  613. <xsl:variable name="ref_obj_sch" select=" system_cache__appinfo:get_object_prefix($ref)"/>
  614. <xsl:value-of select="concat($NamespaceDatabaseStorageDefinitionPrefix.dest,':') pref"/>
  615. </xsl:function>-->
  616. <xsl:template match="@ref" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  617. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  618. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  619. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  620. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  621. <xsl:choose>
  622. <xsl:when test="matches(.,'(.*__x3A__.*:.*)')">
  623. <xsl:attribute name="{ name()}" select=" replace(.,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable)"/>
  624. </xsl:when>
  625. <xsl:otherwise>
  626. <xsl:variable name="ref_obj" select=" system_cache__appinfo:clean_object_prefix(.)"/>
  627. <xsl:attribute name="ref" select="system_cache__appinfo:make_obj_from_prefix_instancetable_objname($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix,$ref_obj,$ref_obj)"/>
  628. <xsl:if test="$suppres_saving"><xsl:attribute name="debug.522.ref" select=" replace(.,$targetNamespace.base.TargetNamespaceBindings_from_Namespace//@NamespacePrefix,$new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix)"/></xsl:if>
  629. <xsl:if test="$suppres_saving"><xsl:attribute name="debug.prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/></xsl:if>
  630. <xsl:if test="$suppres_saving"> <xsl:attribute name="debug.ref.oryg" select="."/></xsl:if>
  631. <xsl:if test="$suppres_saving"><xsl:attribute name="debug.contains_searched" select="$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix"/></xsl:if>
  632. </xsl:otherwise>
  633. </xsl:choose>
  634. </xsl:template>
  635. <xsl:template match="@base|@type" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  636. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  637. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  638. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  639. <!--<xsl:attribute name="{name()}" select=" concat($prototype_NamespacePrefix,':', substring-after(.,':'),'__to__',concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable, ':', replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable )) )"/>-->
  640. <xsl:choose>
  641. <xsl:when test="contains( system_cache__appinfo:get_object_prefix(.),system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,$targetNamespace.base))">
  642. <!--<xsl:attribute name="debug.335" select="$targetNamespace.base"/>-->
  643. <!--<xsl:attribute name="debug.336" select="."/>-->
  644. <!--<xsl:attribute name="debug.337" select="system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,$targetNamespace.base)"/>-->
  645. <!--<xsl:attribute name="{ name()}" select=" replace(., concat(system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,$targetNamespace.base),':'), concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,':', replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable ) ) )"/>-->
  646. <xsl:attribute name="{ name()}" select=" replace(., concat(system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,$targetNamespace.base),':', substring-after(.,':')), concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,':', replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable ) ) )"/>
  647. </xsl:when>
  648. <xsl:otherwise>
  649. <xsl:attribute name="{ name()}" select=" replace(., concat($prototype_NamespacePrefix,':', substring-after(.,':')), concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,':', replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable ) ) )"/>
  650. </xsl:otherwise>
  651. </xsl:choose>
  652. </xsl:template>
  653. <xsl:template match="@system_cache__appinfo:xpath" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  654. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  655. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  656. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  657. <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
  658. <xsl:param name="targetNamespace.base.TargetNamespaceBindings_from_Namespace" required="yes"/>
  659. <xsl:choose>
  660. <xsl:when test="matches(.,'(.*__x3A__.*:.*)')">
  661. <xsl:copy-of select="."/>
  662. </xsl:when>
  663. <xsl:otherwise>
  664. <xsl:variable name="ref_obj" select=" system_cache__appinfo:clean_object_prefix( substring-before(.,'/'))"/>
  665. <xsl:variable name="ref_fld" select=" substring-after(.,'/')"/>
  666. <xsl:attribute name="system_cache__appinfo:xpath" select="concat(system_cache__appinfo:make_obj_from_prefix_instancetable_objname($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix,$ref_obj,$ref_obj),'/',$ref_fld)"/>
  667. </xsl:otherwise>
  668. </xsl:choose>
  669. </xsl:template>
  670. <xsl:template match="@system_cache__appinfo:name" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  671. <xsl:copy-of select="."/>
  672. </xsl:template>
  673. <xsl:template match="@*" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  674. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  675. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  676. <xsl:attribute name="{ name()}" select="."/>
  677. </xsl:template>
  678. <xsl:template match="@id" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
  679. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  680. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  681. <!--<xsl:if test="$prototype_TargetNamespaceBindings_from_Namespace//@NamespacePrefix=$new_TargetNamespaceBindings_from_Namespace//@NamespacePrefix">
  682. <xsl:copy-of select="."/>
  683. </xsl:if>-->
  684. <!-- <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  685. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  686. <xsl:param name="node" required="yes"/>
  687. <xsl:attribute name="{ name()}" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,15),'_',generate-id($node))"/>-->
  688. </xsl:template>
  689. <xsl:template match="@id" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>
  690. <xsl:template match="@name" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
  691. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  692. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  693. <!--<xsl:attribute name="debug.476" select="."/>-->
  694. <!--<xsl:attribute name="debug.477" select="$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable"/>-->
  695. <!--<xsl:attribute name="debug.478" select="$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable"/>-->
  696. <xsl:attribute name="{ name()}" select=" replace(.,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable)"/>
  697. </xsl:template>
  698. <xsl:template match="@type" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
  699. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  700. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  701. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  702. <!--<xsl:attribute name="{name()}" select=" concat($prototype_NamespacePrefix,':', substring-after(.,':'),'__to__',concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable, ':', replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable )) )"/>-->
  703. <xsl:attribute name="{ name()}" select=" replace(., concat($prototype_NamespacePrefix,':', substring-after(.,':')), concat($new_TargetNamespaceBindings_from_Namespace//@NamespaceDatabaseStorageDefinitionPrefix ,'__x3A__', $new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,':', replace( substring-after(.,':'),$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable ) ) )"/>
  704. </xsl:template>
  705. <!--<xsl:template match="@type" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
  706. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  707. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  708. <xsl:param name="prototype_NamespacePrefix" required="yes"/>
  709. <xsl:attribute name="{ name()}" select=" replace(.,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable)"/>
  710. </xsl:template>-->
  711. <xsl:template match="@*" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
  712. <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
  713. <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
  714. <xsl:attribute name="{name()}" select="."/>
  715. </xsl:template>
  716. <xsl:template match="@abstract" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>
  717. <xsl:template match=" text()|comment()" mode="system_cache__appinfo:new_object_by_prototype_schema_child"/>
  718. <xsl:template match=" text()|comment()" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>
  719. <xsl:template mode="system_cache__appinfo:new_object_by_prototype" match="*|text()|comment()"/>
  720. </xsl:stylesheet>