|
|
@@ -1,20 +1,26 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
|
+ xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
|
|
|
xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
|
|
|
exclude-result-prefixes="xs"
|
|
|
version="2.0">
|
|
|
<xsl:output indent="yes"/>
|
|
|
<xsl:strip-space elements="*"/>
|
|
|
-
|
|
|
+ <!-- TEN TEMPLATE NIE JEST DO ROBIENIA STRUKTURY LACZONEJ - UZYJ object_modeling_by_xml_schema.xsl -->
|
|
|
<!--<xsl:include href="get_all_xsd.xsl"/>-->
|
|
|
<!--<xsl:param name="procesy5_system_schema_file" select="'../default_db.instance.xml/transformed/procesy5_system_schema.xml'"/>-->
|
|
|
<xsl:include href="system_cache__appinfo/TargetNamespaceBindings.xsl"/>
|
|
|
<!--<xsl:include href="get_all_xsd.xsl"/>--> <!-- for use system_cache__appinfo:escape_object_prefix_to_string -->
|
|
|
+ <xsl:include href="system_cache__appinfo/vrtfNamespaces.xsl"/>
|
|
|
|
|
|
- <xsl:param name="prototype_object_namespace" select="'https://biuro.biall-net.pl/wfs/default_db/Types/Infrastructure.xsd'"/>
|
|
|
+ <xsl:param name="prototype_object_namespace" select="'https://biuro.biall-net.pl/wfs/default_db/Types/Empty.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.base" required="yes"/> <!-- usually biuro.biall-net.pl/xmlschema_procesy5/default_db -->
|
|
|
+ <xsl:param name="object_modeling.Error.Handling" required="yes"/>
|
|
|
+ <xsl:param name="NamespaceObjectInstanceTable" required="yes"/>
|
|
|
+ <xsl:param name="merge_priority" select="'database'"/> <!-- for default_db or prototype -->
|
|
|
+ <!--<xsl:param name="new_object.name" required="yes"/>--> <!-- Musi byc name = np ACCESS_REQUESTS -->
|
|
|
<!--<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 -->
|
|
|
|
|
|
@@ -39,22 +45,40 @@
|
|
|
</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:message>#72 system_cache__appinfo:new_object_by_prototype with param testing:
|
|
|
+ $targetNamespace.base = <xsl:value-of select="$targetNamespace.base"/>
|
|
|
+ $new_object_namespace = <xsl:value-of select="$new_object_namespace"/>
|
|
|
+ $prototype_object_namespace = <xsl:value-of select="$prototype_object_namespace"/>
|
|
|
+ searching for @targetNamespace = <xsl:value-of select="substring-after($targetNamespace.base,'://')"/> ($targetNamespace.base)
|
|
|
+ </xsl:message>
|
|
|
+ <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"/>
|
|
|
+
|
|
|
+ <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 <xsl:value-of select="$targetNamespace.base"/></xsl:message></xsl:if>
|
|
|
+ <xsl:message>#26 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>
|
|
|
+ <!--<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:variable name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="system_cache__appinfo:get_all_xsd_default_db/schema[ substring-after(@targetNamespace,'://')=substring-after($targetNamespace.base,'://')]/simpleType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
|
|
|
+ <xsl:message>#26 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>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="$prototype_object_namespace and $new_object_namespace">
|
|
|
+ <xsl:message>#55 when test="$prototype_object_namespace and $new_object_namespace"</xsl:message>
|
|
|
<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:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:variable>
|
|
|
+ <xsl:message>#61 $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>
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="$system_cache__appinfo:new_object_by_prototype_test_if_prototype/*">
|
|
|
- <xsl:variable name="system_cache__appinfo:new_object_by_prototype.base" select="system_cache__appinfo:get_all_xsd_default_db/schema"/>
|
|
|
+ <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"/>
|
|
|
+ <xsl:message>#65 $system_cache__appinfo:new_object_by_prototype.base is in schema - OK applying</xsl:message>
|
|
|
+ <!-- podciagniecie brakujacych simpleschema -->
|
|
|
+
|
|
|
+
|
|
|
+ <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>
|
|
|
<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:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
@@ -69,8 +93,11 @@
|
|
|
|
|
|
<xsl:template mode="system_cache__appinfo:new_object_by_prototype" match="system_cache__appinfo:get_all_xsd">
|
|
|
<xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/>
|
|
|
+ <xsl:message>#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:message>
|
|
|
<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:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:template>
|
|
|
|
|
|
@@ -84,11 +111,94 @@
|
|
|
|
|
|
<xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="*|text()|comment()"/>
|
|
|
|
|
|
+ <xsl:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="text()|comment()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
|
|
|
|
|
|
+ <xsl:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="schema" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <!-- add needed simpleType from prototype -->
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/><!-- this is complexType -->
|
|
|
+ <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:message>#118 matched schema mode system_cache__appinfo:new_object_by_prototype.base.simpleType </xsl:message>
|
|
|
+ <xsl:variable name="base.simpleSchema.to.unique">
|
|
|
+
|
|
|
+ <xsl:variable name="current" select="."/>
|
|
|
+ <xsl:for-each select="$system_cache__appinfo:new_object_by_prototype.base//element[@type]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <xsl:variable name="current.base" select="."/>
|
|
|
+ <xsl:for-each-group select="$current//element[@type]" group-by="@type" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$current.base/@name = current()/@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <xsl:message>#143 detected @name=<xsl:value-of select="$current.base/@name"/>; @type=<xsl:value-of select="$current.base/@type"/>; bypassing</xsl:message>
|
|
|
+ <!--<xsl:comment>#143 detected @name=<xsl:value-of select="$current.base/@name"/>; @type=<xsl:value-of select="$current.base/@type"/>; bypassing</xsl:comment>-->
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <!--<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"/>-->
|
|
|
+ <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">
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+ <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:apply-templates>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each-group>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:for-each-group select="$base.simpleSchema.to.unique/simpleType" group-by="@name" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ </xsl:for-each-group>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
+ <xsl:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <!-- add needed simpleType from prototype -->
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/><!-- this is complexType -->
|
|
|
+
|
|
|
+ <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype.base.simpleType">
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
- <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:template mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" match="element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <!-- add needed simpleType from prototype -->
|
|
|
<xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" required="yes"/><!-- this is complexType -->
|
|
|
+
|
|
|
+ <xsl:message>#115 matched sequence/ </xsl:message>
|
|
|
+ <xsl:comment>#115 matched sequence/ </xsl:comment>
|
|
|
+
|
|
|
+ <xsl:variable name="current" select="current()"/>
|
|
|
+ <!--<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 -\->-->
|
|
|
+ <!-- najpierw sprawdzamy czy element juz nie byl, priorytet ma @typ z prototypu? todo -->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$current/@name = current()/@name">
|
|
|
+ <xsl:message>#143 detected @name=<xsl:value-of select="@name"/>; element/@type=<xsl:value-of select="@type"/>; bypassing</xsl:message>
|
|
|
+ <xsl:comment>
|
|
|
+#143 detected <xsl:value-of select="@name"/> element, bypassing
|
|
|
+</xsl:comment>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <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>
|
|
|
+ <xsl:comment>
|
|
|
+#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) ])"/>
|
|
|
+</xsl:comment>
|
|
|
+ <!--<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"/>-->
|
|
|
+ <xsl:value-of select="$system_cache__appinfo:new_object_by_prototype.base.simpleType/name()" xpath-default-namespace="http://www.w3.org/2001/XMLSchema"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- </xsl:for-each>-->
|
|
|
+
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <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"/> <!-- this is complexType -->
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" 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"/>
|
|
|
@@ -120,9 +230,9 @@
|
|
|
<xsl:copy-of select="$prototype_NamespacePrefix"/>
|
|
|
</prototype_NamespacePrefix>
|
|
|
<xsl:choose>
|
|
|
- <xsl:when test=" doc-available(concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd'))">
|
|
|
+ <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'))">
|
|
|
<ERROR>
|
|
|
- <xsl:attribute name="message" select="'document already generated and aviable'"/>
|
|
|
+ <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')"/>
|
|
|
OUTPUT__START
|
|
|
document already generated and aviable
|
|
|
OUTPUT__END
|
|
|
@@ -130,32 +240,47 @@
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
<xsl:result-document href="{ concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd')}">
|
|
|
+ <xsl:message>#139 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>
|
|
|
<!--<xsl:attribute name="href" select=" concat($procesy5_system_schema_collection_dir,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceType,'/',$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'.xsd')"/>-->
|
|
|
<xsl:element name="xs:schema">
|
|
|
<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:if test="$vc:minVersion"><xsl:attribute name="vc:minVersion" select="$vc:minVersion"/></xsl:if>
|
|
|
+ <xsl:if test="$vc:maxVersion"><xsl:attribute name="vc:maxVersion" select="$vc:maxVersion"/></xsl:if>
|
|
|
<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>
|
|
|
+ <!--<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>
|
|
|
+ </debug.143>-->
|
|
|
+ <!--<debug.147.base>
|
|
|
|
|
|
<xsl:copy-of select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
- </debug.147.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:apply-templates mode="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="." >
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base.simpleType" select="$system_cache__appinfo:new_object_by_prototype.base.simpleType"/>
|
|
|
+ <xsl:with-param name="system_cache__appinfo:new_object_by_prototype.base" select="$system_cache__appinfo:new_object_by_prototype.base"/>
|
|
|
+
|
|
|
+ <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:apply-templates>
|
|
|
</xsl:element>
|
|
|
</xsl:result-document>
|
|
|
</xsl:otherwise>
|
|
|
@@ -168,16 +293,14 @@
|
|
|
<xsl:copy-of select="."/>
|
|
|
</xsl:template>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="element|complexType|simpleType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
<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: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>
|
|
|
<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"/>
|
|
|
@@ -189,6 +312,30 @@
|
|
|
<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:template>
|
|
|
+
|
|
|
+ <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="element|simpleType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <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:value-of select="*/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"/>
|
|
|
+ <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ <!--<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())"/>-->
|
|
|
+ <!--<xsl:attribute name="name" select=" replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'InfrastructureAAAA')"/>-->
|
|
|
+ <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
|
|
|
+ <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:template>
|
|
|
@@ -197,22 +344,58 @@
|
|
|
<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:message>#200 matched <xsl:value-of select="name()"/></xsl:message>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+ <xsl:message>#200 matched <xsl:value-of select="name()"/>//<xsl:value-of select="*/name()"/></xsl:message>
|
|
|
<xsl:element name="{name()}">
|
|
|
<!--<xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,15),'_',generate-id())"/>-->
|
|
|
<xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
|
|
|
<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:variable name="current" select="."/>
|
|
|
+ <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>
|
|
|
+ <xsl:for-each select="$system_cache__appinfo:new_object_by_prototype.base/sequence/element" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@name">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$current/element[@name = current()/@name]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
+ <xsl:message>#272 found ignored <xsl:value-of select="@name"/></xsl:message>
|
|
|
+ <xsl:comment>#272 found ignored <xsl:value-of select="@name"/></xsl:comment>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:comment>#272-A found adding <xsl:value-of select="@name"/>, $prototype_NamespacePrefix = <xsl:value-of select="$prototype_NamespacePrefix"/></xsl:comment>
|
|
|
+ <xsl:element name="{name()}">
|
|
|
+ <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child" select="@*">
|
|
|
+ <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="node" select="."/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="@ref">
|
|
|
+ <xsl:message terminate="yes">#288 unsupported yed @ref <xsl:value-of select="@ref"/></xsl:message>
|
|
|
+ </xsl:when>
|
|
|
+
|
|
|
+
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
</xsl:element>
|
|
|
</xsl:template>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<xsl:template match="element|complexContent|restriction|enumeration|minInclusive" mode="system_cache__appinfo:new_object_by_prototype_schema_child" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
|
|
|
<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:message>#215 matched <xsl:value-of select="name()"/>/<xsl:value-of select="@name"/></xsl:message>
|
|
|
+ <xsl:param name="system_cache__appinfo:new_object_by_prototype.base" required="yes"/>
|
|
|
+ <xsl:message>#215 matched <xsl:value-of select="name()"/>/<xsl:value-of select="@name"/>//<xsl:value-of select="*/name()"/></xsl:message>
|
|
|
<xsl:element name="{name()}">
|
|
|
<xsl:copy-of select="@minOccurs"/>
|
|
|
<xsl:copy-of select="@maxOccurs"/>
|
|
|
@@ -226,7 +409,9 @@
|
|
|
<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:template>
|
|
|
|
|
|
@@ -255,7 +440,19 @@
|
|
|
<xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
|
|
|
<xsl:param name="prototype_NamespacePrefix" required="yes"/>
|
|
|
<!--<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 )) )"/>-->
|
|
|
- <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 ) ) )"/>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="contains( system_cache__appinfo:get_object_prefix(.),system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,$targetNamespace.base))">
|
|
|
+ <!--<xsl:attribute name="debug.335" select="$targetNamespace.base"/>-->
|
|
|
+ <!--<xsl:attribute name="debug.336" select="."/>-->
|
|
|
+ <!--<xsl:attribute name="debug.337" select="system_cache__appinfo:prefix_from_targetNamespace($system_cache__appinfo:vrtfNamespaces,$targetNamespace.base)"/>-->
|
|
|
+ <!--<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 ) ) )"/>-->
|
|
|
+ <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 ) ) )"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <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 ) ) )"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
</xsl:template>
|
|
|
|
|
|
<xsl:template match="@*" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
|
|
|
@@ -276,6 +473,9 @@
|
|
|
<xsl:template match="@name" mode="system_cache__appinfo:new_object_by_prototype_schema_root">
|
|
|
<xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
|
|
|
<xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
|
|
|
+ <!--<xsl:attribute name="debug.476" select="."/>-->
|
|
|
+ <!--<xsl:attribute name="debug.477" select="$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable"/>-->
|
|
|
+ <!--<xsl:attribute name="debug.478" select="$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable"/>-->
|
|
|
<xsl:attribute name="{ name()}" select=" replace(.,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable)"/>
|
|
|
</xsl:template>
|
|
|
|