|
|
@@ -14,19 +14,48 @@
|
|
|
|
|
|
<xsl:param name="prototype_object_namespace" select="'https://biuro.biall-net.pl/wfs/default_db/Types/Infrastructure.xsd'"/>
|
|
|
<xsl:param name="new_object_namespace"/> <!-- example https://biuro.biall-net.pl/wfs/default_db/table/CRM_PROCES.xsd -->
|
|
|
+ <xsl:param name="targetNamespace.base" required="yes"/>
|
|
|
+ <!--<xsl:param name="targetNamespace_DEFAULTS" select="'http://biuro.biall-net.pl/xmlschema_procesy5/default_db'"/>-->
|
|
|
<!--<xsl:param name="procesy5_system_schema_collection_dir" select="'../../'"/>--> <!-- should be like /Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html -->
|
|
|
|
|
|
|
|
|
+ <xsl:template name="system_cache__appinfo:check_if_schema_element_exists_by_base">
|
|
|
+ <xsl:param name="base"/>
|
|
|
+ <xsl:param name="prototype"/>
|
|
|
+ <xsl:for-each select="$base">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$prototype[ not(@name=current()/@name) and not(name()=current()/name())]">
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ <!--<xsl:element name="{name()}">
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:call-template name="system_cache__appinfo:check_if_schema_element_exists_by_base">
|
|
|
+ <xsl:with-param name="base" select=""/>
|
|
|
+ <xsl:with-param name="prototype"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:element>-->
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
<xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:new_object_by_prototype">
|
|
|
+ <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,'://')]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
|
|
|
+ <xsl:if test="not($system_cache__appinfo:new_object_by_prototype.base/complexType)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"><xsl:message terminate="yes">#25 unknow source object - not found for <xsl:value-of select="$targetNamespace.base"/></xsl:message></xsl:if>
|
|
|
+ <xsl:message>#26 <xsl:value-of select="count($system_cache__appinfo:new_object_by_prototype.base/complexType)" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/></xsl:message>
|
|
|
+ <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>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="$prototype_object_namespace and $new_object_namespace">
|
|
|
<xsl:variable name="system_cache__appinfo:new_object_by_prototype_test_if_prototype">
|
|
|
- <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype"/>
|
|
|
+ <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype">
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
</xsl:variable>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="$system_cache__appinfo:new_object_by_prototype_test_if_prototype/*">
|
|
|
- <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype"/>
|
|
|
+ <xsl:variable name="system_cache__appinfo:new_object_by_prototype.base" select="system_cache__appinfo:get_all_xsd_default_db/schema"/>
|
|
|
+ <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype">
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
<xsl:message terminate="yes">#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>
|
|
|
@@ -39,7 +68,10 @@
|
|
|
</xsl:template>
|
|
|
|
|
|
<xsl:template mode="system_cache__appinfo:new_object_by_prototype" match="system_cache__appinfo:get_all_xsd">
|
|
|
- <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype"/>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+ <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype">
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
@@ -56,6 +88,7 @@
|
|
|
|
|
|
|
|
|
<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">
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
<xsl:variable name="prototype_TargetNamespaceBindings_from_Namespace">
|
|
|
<xsl:call-template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
|
|
|
<xsl:with-param name="TargetNamespace" select="$prototype_object_namespace"/>
|
|
|
@@ -102,10 +135,26 @@
|
|
|
<xsl:copy-of select="namespace::node()"/>
|
|
|
<xsl:namespace name="{$new_TargetNamespaceBindings_from_Namespace//@NamespacePrefix}" select="$new_object_namespace"/>
|
|
|
<xsl:attribute name="targetNamespace" select="$new_object_namespace"/>
|
|
|
+ <xsl:variable name="system_cache__appinfo:check_if_schema_element_exists_by_base" >
|
|
|
+ <xsl:call-template name="system_cache__appinfo:check_if_schema_element_exists_by_base">
|
|
|
+ <xsl:with-param name="base" select="$system_cache__appinfo:new_object_by_prototype.base/*"/>
|
|
|
+ <xsl:with-param name="prototype" select="*"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:variable>
|
|
|
+ <debug.143>
|
|
|
+ <xsl:attribute name="base" select="$system_cache__appinfo:new_object_by_prototype.base/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" />
|
|
|
+ <xsl:attribute name="prototype" select="name()"/>
|
|
|
+ <xsl:copy-of select="$system_cache__appinfo:check_if_schema_element_exists_by_base"/>
|
|
|
+ </debug.143>
|
|
|
+ <debug.147.base>
|
|
|
+
|
|
|
+ <xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+ </debug.147.base>
|
|
|
<xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_root">
|
|
|
<xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
|
|
|
<xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
|
|
|
<xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:element>
|
|
|
</xsl:result-document>
|
|
|
@@ -125,7 +174,10 @@
|
|
|
<xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
|
|
|
<xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
|
|
|
<xsl:param name="prototype_NamespacePrefix" required="yes"/>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+
|
|
|
<xsl:element name="{name()}">
|
|
|
+ <xsl:message>#145 debug name form prototype is <xsl:value-of select="$system_cache__appinfo:new_object_by_prototype.base/name()"/></xsl:message>
|
|
|
<xsl:apply-templates select="@*" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
|
|
|
<xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
|
|
|
<xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
|