| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516 |
- <?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/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"/> <!-- 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 -->
-
-
- <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: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[ 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>
- <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>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:when>
- <xsl:otherwise><xsl:message terminate="yes">#25 not set required $prototype_object_namespace and $new_object_namespace params!</xsl:message></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <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>
-
-
- <xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="system_cache__appinfo:get_all_xsd">
- <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype"/>
- </xsl:template>
- <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">
- <system_cache__appinfo:new_object_by_prototype_test_if_prototype>exists_flag</system_cache__appinfo:new_object_by_prototype_test_if_prototype>
- </xsl:template>
-
- <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.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"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="new_TargetNamespaceBindings_from_Namespace">
- <xsl:call-template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
- <xsl:with-param name="TargetNamespace" select="$new_object_namespace"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="prototype_NamespacePrefix">
- <xsl:for-each select="namespace::node()">
- <xsl:if test=".= $prototype_object_namespace">
- <xsl:value-of select="name()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <system_cache__appinfo:new_object_by_prototype>
- <xsl:attribute name="prototype_object_namespace" select="$prototype_object_namespace"/>
- <xsl:attribute name="new_object_namespace" select="$new_object_namespace"/>
- <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')"/>
- <prototype_TargetNamespaceBindings_from_Namespace>
- <xsl:copy-of select="$prototype_TargetNamespaceBindings_from_Namespace"/>
- </prototype_TargetNamespaceBindings_from_Namespace>
- <new_TargetNamespaceBindings_from_Namespace>
- <xsl:copy-of select="$new_TargetNamespaceBindings_from_Namespace"/>
- </new_TargetNamespaceBindings_from_Namespace>
- <prototype_NamespacePrefix>
- <xsl:copy-of select="$prototype_NamespacePrefix"/>
- </prototype_NamespacePrefix>
- <xsl:choose>
- <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="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
- </ERROR>
- </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>
- <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: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>
- </xsl:choose>
- </system_cache__appinfo:new_object_by_prototype>
- </xsl:template>
-
-
- <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="import" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <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: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>
-
- <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>
-
- <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">
- <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: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: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"/>
- <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: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>
-
- <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">
- <xsl:element name="{name()}">
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="text()"/>
- <xsl:copy-of select="system_cache__appinfo:base_type"/>
- <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="system_cache__appinfo:flat_relation_cache" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template match="@ref" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
- <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:attribute name="{ name()}" select=" replace(.,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable)"/>
- </xsl:template>
-
- <xsl:template match="@base|@type" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
- <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: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: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">
- <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
- <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
- <xsl:attribute name="{ name()}" select="."/>
- </xsl:template>
-
- <xsl:template match="@id" mode="system_cache__appinfo:new_object_by_prototype_schema_child">
- <!-- <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
- <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
- <xsl:param name="node" required="yes"/>
- <xsl:attribute name="{ name()}" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,15),'_',generate-id($node))"/>-->
- </xsl:template>
-
- <xsl:template match="@id" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>
- <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>
-
- <xsl:template match="@type" 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: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:template>
-
- <!--<xsl:template match="@type" 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:param name="prototype_NamespacePrefix" required="yes"/>
- <xsl:attribute name="{ name()}" select=" replace(.,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable)"/>
- </xsl:template>-->
-
- <xsl:template match="@*" 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="{name()}" select="."/>
- </xsl:template>
-
- <xsl:template match="@abstract" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>
-
- <xsl:template match=" text()|comment()" mode="system_cache__appinfo:new_object_by_prototype_schema_child"/>
-
- <xsl:template match=" text()|comment()" mode="system_cache__appinfo:new_object_by_prototype_schema_root"/>
-
- <xsl:template mode="system_cache__appinfo:new_object_by_prototype" match="*|text()|comment()"/>
-
-
-
-
-
-
- </xsl:stylesheet>
|