| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
- xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
- xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p5dkp.dita.values="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.dita.values.xsd"
- exclude-result-prefixes="xs vc p5bws system_cache__appinfo p5dkp p5suis xsi p5dkp.dita.values"
- version="2.0">
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
- <xsl:param name="p5dkp.dita.values:xsd" required="yes"/> <!-- do parsowania asserts -->
-
- <xsl:variable name="p5dkp.dita.values.xsd" select="doc($p5dkp.dita.values:xsd)"/>
-
- <xsl:template mode="p5dkp:dita.values" match="text()|comment()"/>
-
- <xsl:template match="*[*]" mode="p5dkp:dita.values"/>
-
- <xsl:template match="*" mode="p5dkp:dita.values">
- <p>
- <ph>
- <xsl:value-of select="name()"/><xsl:text> : </xsl:text>
- </ph>
- <xsl:choose>
- <xsl:when test="@p5dkp:idref">
- <ph keyref="{@p5dkp:idref}"> </ph>
- </xsl:when>
- <xsl:when test="@p5dkp:id">
- <ph keyref="{@p5dkp:id}"> </ph>
- </xsl:when>
-
- <xsl:otherwise>
- <ph> <xsl:value-of select="text()"/> </ph>
- </xsl:otherwise>
- </xsl:choose>
- </p>
- </xsl:template>
-
-
-
- <xsl:template mode="p5dkp.dita.values:xsd" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="import|redefine">
- <xsl:param name="import" required="yes"/>
- <xsl:param name="redefine"/>
-
- <!--<xsl:message>#50 $import =
- <xsl:for-each select="$import//@namespace">
- ==<xsl:value-of select="."/>;
- </xsl:for-each>;
- </xsl:message>-->
-
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:variable name="namespace">
- <xsl:choose>
- <xsl:when test="not(@namespace)">
- <xsl:value-of select="concat(../@targetNamespace,'-',tokenize(@schemaLocation,'/')[ position() = last()])"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@namespace"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="import">
- <import>
- <!--<xsl:for-each select="$import//@namespace">
- <namespace>
- <xsl:attribute name="namespace" select="."/>
- </namespace>
- </xsl:for-each>-->
- <xsl:copy-of select="$import/import/*" xpath-default-namespace=""/>
- <namespace>
- <xsl:attribute name="namespace" select="$namespace"/>
- </namespace>
- </import>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test=" not(matches($namespace,'p5dkp'))">
- <xsl:message>#71 not(matches(@namespace,'p5dkp')) = <xsl:value-of select="$namespace"/></xsl:message>
- </xsl:when>
- <xsl:when test=" count($import//*[@namespace = $namespace]) > 1">
- <xsl:message>#74 Ignoring recurse import for @namespace=<xsl:value-of select="$namespace"/>; and @schemaLocation = <xsl:value-of select="@schemaLocation"/>;</xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="doc-available(@schemaLocation)">
- <xsl:message>#66 opening <xsl:value-of select="@schemaLocation"/>
- @namespace=<xsl:value-of select="$namespace"/>;
- count $import = <xsl:value-of select="count($import//*)"/> - with own @namespace = <xsl:value-of select="count($import//*[@namespace = $namespace])"/></xsl:message>
- <!--<xsl:message>#79 $import =
- <xsl:for-each select="$import//@namespace">
- ==<xsl:value-of select="."/>;
- </xsl:for-each>;
- </xsl:message>-->
-
- <xsl:apply-templates mode="#current" select="doc(@schemaLocation)">
- <xsl:with-param name="import" select="$import"/>
- <xsl:with-param name="redefine" select="$redefine"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#72 unaviable doc <xsl:value-of select="@schemaLocation"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="#current" >
- <xsl:with-param name="import" select="$import"/>
- <xsl:with-param name="redefine" select="$redefine"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template mode="p5dkp.dita.values:xsd" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="#current"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template mode="p5dkp.dita.values:xsd" xpath-default-namespace="http://www.w3.org/2001/XMLSchema" match="schema">
- <xsl:param name="import" required="yes"/>
- <xsl:param name="redefine"/>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="#current">
- <xsl:with-param name="import" select="$import"/>
- <xsl:with-param name="redefine" select="$redefine"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template mode="p5dkp.dita.values:dita.values.xml #default" match="p5dkp:map.budzet_rola.xml">
- <p5dkp.dita.values:dita.values.xml xsi:noNamespaceSchemaLocation="{$p5dkp.dita.values:xsd}">
- <xsl:variable name="import">
- <import>
- <!--<namespace namespace="dupajasiu"/>-->
- </import>
- </xsl:variable>
- <xsl:variable name="redefine">
- <redefine/>
- </xsl:variable>
- <xsl:variable name="p5dkp.dita.values:xsd">
- <p5dkp.dita.values:xsd>
- <xsl:apply-templates mode="p5dkp.dita.values:xsd" select="$p5dkp.dita.values.xsd">
- <xsl:with-param name="import" select="$import"/>
- <xsl:with-param name="redefine" select="$redefine"/>
- </xsl:apply-templates>
- </p5dkp.dita.values:xsd>
- </xsl:variable>
-
- <xsl:copy-of select="$p5dkp.dita.values:xsd"/>
- <xsl:variable name="context" select="current()"/>
- <xsl:for-each select="$p5dkp.dita.values:xsd//element[@name='dita.values.xml']//sequence/*" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
- <xsl:choose>
- <xsl:when test="$context/*[ name() = current()/@ref]">
- <xsl:message>#162 applying asserts to <xsl:value-of select="@ref"/></xsl:message>
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>#162-B NOT FOUND to applying asserts to <xsl:value-of select="@ref"/>/name() = <xsl:value-of select="name()"/>;</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <!--<xsl:copy-of select="$p5dkp.dita.values.xsd"/>-->
- </p5dkp.dita.values:dita.values.xml>
- </xsl:template>
-
- </xsl:stylesheet>
|