| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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"
- exclude-result-prefixes="xs"
- xmlns:default_db__x3A__NEURO_MIND_INPUT_TEXT="https://biuro.biall-net.pl/wfs/default_db/table/NEURO_MIND_INPUT_TEXT.xsd"
- xmlns:default_db__x3A__STRUCTURE="https://biuro.biall-net.pl/wfs/default_db/table/STRUCTURE.xsd"
- version="2.0">
-
-
-
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
- <!-- TODO co to ma robic innego niz init? reagowac na elementy import export wszedzie w shematach? -->
-
-
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="xs:schema">
- <xsl:copy>
- <xsl:call-template name="default_db__x3A__STRUCTURE:document-uri"/>
- <xsl:call-template name="default_db__x3A__STRUCTURE:generate-id"/>
- <xsl:apply-templates mode="default_db__x3A__STRUCTURE:import" select="xs:complexType[@name='init']|xs:import|xs:element|xs:group" />
- </xsl:copy>
- </xsl:template>
-
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="*">
- <xsl:copy>
- <xsl:call-template name="default_db__x3A__STRUCTURE:generate-id"/>
- <xsl:apply-templates mode="#current" select="@*"/>
- <xsl:apply-templates mode="#current" />
- </xsl:copy>
- </xsl:template>
-
-
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="xs:annotation[xs:documentation and not(xs:appinfo)]"/>
-
-
-
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="@*">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:function name="default_db__x3A__STRUCTURE:import.element.ref.document-uri">
- <xsl:param name="context"/>
- <xsl:param name="ref"/>
- <xsl:variable name="namespace-uri-for-prefix" select="namespace-uri-for-prefix(substring-before($ref,':'),$context)"/>
- <xsl:message>#45 poNS/n[[<xsl:value-of select="$context/root()//*[name()=$context/name() ][1]/@*"/>]]</xsl:message>
- <!-- $namespace-uri-for-prefix <xsl:value-of select="$namespace-uri-for-prefix"/> -->
- <xsl:choose>
- <xsl:when test="$context/root()//*[name()=$context/name() ]" xpath-default-namespace="{namespace-uri-for-prefix(default_db__x3A__STRUCTURE:prefix.get($ref),$context)}"> <!-- $context/ancestor-or-self::*[name()=$context/name() and @name=default_db__x3A__STRUCTURE:prefix.clean($ref)] -->
- <!--<DEBUG debug="dziala #$8"><xsl:copy-of select="$context/root()//*[name()=$context/name() ]"/></DEBUG>-->
- <xsl:message>#45 dziala po namespacie</xsl:message>
- <xsl:value-of select="''"/>
- </xsl:when>
- <xsl:when test="count($context/preceding::xs:import[@namespace=$namespace-uri-for-prefix]) >1">
- <xsl:message terminate="yes">#50 unsupported multiple import same namespace <xsl:copy-of select="$context/ancestor::xs:schema/xs:import[@namespace=$namespace-uri-for-prefix]" copy-namespaces="no"/></xsl:message>
- </xsl:when>
- <xsl:when test="count($context/preceding::xs:import[@namespace=$namespace-uri-for-prefix]) = 1">
- <xsl:value-of select="$context/preceding::xs:import[@namespace=$namespace-uri-for-prefix]/@schemaLocation"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">#56 error not found $ref = [[ <xsl:value-of select="$ref"/> ]
-
- $context/n = [[<xsl:value-of select="$context/name()"/>]] /@n[[[<xsl:value-of select="$context/@name"/>]]] @r[[[<xsl:value-of select="$context/@ref"/>]]] @ty[[[<xsl:value-of select="$context/@type"/>]]] @*[<xsl:copy-of select="$context/@*" copy-namespaces="no"/>]
- for $namespace-uri-for-prefix[<xsl:value-of select="$namespace-uri-for-prefix"/>] $context/preceding::xs:import[@namespace=$namespace-uri-for-prefix]/@schemaLocation </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:function>
-
- <xsl:template name="default_db__x3A__STRUCTURE:import.element.ref.document-uri" match="xs:element[@ref]">
- <xsl:call-template name="default_db__x3A__STRUCTURE:import.element.ref.document-uri"/>
- <!--<xsl:apply-templates mode="#current" select="doc(default_db__x3A__STRUCTURE:import.element.ref.document-uri(.,@ref))/xs:schema/xs:complexType[@name='init']"/>-->
- </xsl:template>
-
-
- <!--<xsl:template mode="default_db__x3A__STRUCTURE:import" match="xs:element[@ref and preceding::*[@default_db__x3A__STRUCTURE:generate-id = current()/@default_db__x3A__STRUCTURE:generate-id] ]" priority="5">
- <xsl:message terminate="no">#75 KEY LOOP <xsl:value-of select="@default_db__x3A__STRUCTURE:generate-id"/></xsl:message>
- <xsl:comment>#75 KEY LOOP <xsl:value-of select="@default_db__x3A__STRUCTURE:generate-id"/></xsl:comment>
- </xsl:template>-->
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="xs:element[@ref and preceding::*[@default_db__x3A__STRUCTURE:generate-id = current()/@default_db__x3A__STRUCTURE:generate-id][2] ]" priority="9">
- <xsl:variable name="default_db__x3A__STRUCTURE:generate-id" select="@default_db__x3A__STRUCTURE:generate-id"/>
- <xsl:message terminate="no">#75-KEY KEY LOOP <xsl:value-of select="@default_db__x3A__STRUCTURE:generate-id"/>; 1Key[[[<xsl:value-of select="count(preceding::*[key('default_db__x3A__STRUCTURE:generate-id',current()/@default_db__x3A__STRUCTURE:generate-id) ])"/>]]]/2$Key[[[<xsl:value-of select="count(preceding::*[key('default_db__x3A__STRUCTURE:generate-id',$default_db__x3A__STRUCTURE:generate-id) ])"/>]]]/3Pr$[[[<xsl:value-of select="count(preceding::*[@default_db__x3A__STRUCTURE:generate-id = $default_db__x3A__STRUCTURE:generate-id])"/>]]]/4Pr[[[<xsl:value-of select="count(preceding::*[@default_db__x3A__STRUCTURE:generate-id = current()/@default_db__x3A__STRUCTURE:generate-id])"/>]]]</xsl:message>
- <!--<xsl:for-each select="preceding::*[@default_db__x3A__STRUCTURE:generate-id = current()/@default_db__x3A__STRUCTURE:generate-id]">
- <xsl:if test="position() <20">
- <xsl:message>[[@<xsl:value-of select="position()"/>][<xsl:value-of select="@default_db__x3A__STRUCTURE:generate-id"/>]n/<xsl:value-of select="local-name()"/>;/@n/<xsl:value-of select="@name"/>]</xsl:message>
- </xsl:if>
- </xsl:for-each>-->
- </xsl:template>
-
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="xs:element[@ref]">
- <!--<xsl:apply-templates mode="#current" select="doc('NEURO_MIND_INPUT_SENTENCE.xsd')/xs:schema/xs:complexType[@name='import']"/>-->
- <!--<xsl:copy-of select=""/>-->
- <!--<xsl:copy-of select="default_db__x3A__STRUCTURE:import.element.ref.document-uri(.,@ref)"></xsl:copy-of>-->
- <xsl:message>#82 Loop chk key <xsl:value-of select="count(key('default_db__x3A__STRUCTURE:generate-id',preceding::*/@default_db__x3A__STRUCTURE:generate-id))"/>; </xsl:message>
- <xsl:variable name="namespace-uri-for-prefix" select="namespace-uri-for-prefix(default_db__x3A__STRUCTURE:prefix.get(@ref),.)"/>
- <xsl:comment>#76t [ref=<xsl:value-of select="@ref"/>;] - SNFP[<xsl:value-of select="$namespace-uri-for-prefix"/>]
- SNFP/#C[[<xsl:value-of select="count(root()//*[name()='default_db__x3A__NEURO_MIND_INPUT_LETTER:NEURO_MIND_INPUT_LETTER'])" xpath-default-namespace="{$namespace-uri-for-prefix}"/>]] url=[[<xsl:value-of select="default_db__x3A__STRUCTURE:import.element.ref.document-uri(.,@ref)"/>]]</xsl:comment>
- <xsl:choose>
- <!--<xsl:when test="default_db__x3A__STRUCTURE:import.element.ref.document-uri(.,@ref)=''">
- <ERROR_NULL>asd</ERROR_NULL>
- </xsl:when>-->
- <xsl:when test="root()//*[name()=current()/@ref]">
- <default_db__x3A__STRUCTURE:import__DEBUG debug="#85 jest wariant z nazwa cala.. - bierzemy jeden tylko?">
- <xsl:apply-templates mode="#current" select="root()//*[name()=current()/@ref][1]"/>
- </default_db__x3A__STRUCTURE:import__DEBUG>
- </xsl:when>
- <xsl:when test="root()//*[name()=current()/name() and @name=default_db__x3A__STRUCTURE:prefix.clean(current()/@ref)] and default_db__x3A__STRUCTURE:import.element.ref.document-uri(.,@ref)=''" xpath-default-namespace="{$namespace-uri-for-prefix}">
- <ERROR_NULL_DNS_OK>
- <xsl:copy-of select="root()//*[name()=current()/name() and @name=default_db__x3A__STRUCTURE:prefix.clean(current()/@ref)][1]" xpath-default-namespace="{$namespace-uri-for-prefix}"></xsl:copy-of>
- </ERROR_NULL_DNS_OK>
- </xsl:when>
- <xsl:when test="default_db__x3A__STRUCTURE:import.element.ref.document-uri(.,@ref)=''">
- <ERROR_NULL>76t - NULL </ERROR_NULL>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#115 TODO TO MIGRATO DOC FROM IMPORT - should be only - co dociagnac?</xsl:message>
- <xsl:apply-templates mode="#current" select="doc(default_db__x3A__STRUCTURE:import.element.ref.document-uri(.,@ref))"/> <!-- /xs:schema/xs:complexType[@name='init'] --><!-- default_db__x3A__NEURO_MIND_INPUT_SENTENCE:import -->
- </xsl:otherwise>
- </xsl:choose>
-
-
- </xsl:template>
-
-
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="text()">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template mode="default_db__x3A__STRUCTURE:import" match="comment()"/>
-
-
-
-
- </xsl:stylesheet>
|