|
|
@@ -0,0 +1,157 @@
|
|
|
+<?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:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
|
|
|
+ exclude-result-prefixes="xs"
|
|
|
+ version="2.0">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:include href="escape_functions.xsl"/>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:document-uri_for_external_schema_id_namespace_prefix">
|
|
|
+ <xsl:param name="system_cache__appinfo:document-uri_from_external_schema"/>
|
|
|
+ <xsl:value-of select="substring-after(replace($system_cache__appinfo:document-uri_from_external_schema,$external_schema,$external_schema_id_namespace_prefix ), '/public_html/') "/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:document-uri-full_for_external_schema_id_namespace_prefix">
|
|
|
+ <xsl:param name="system_cache__appinfo:document-uri_from_external_schema"/>
|
|
|
+ <xsl:value-of select="replace($system_cache__appinfo:document-uri_from_external_schema,$external_schema,$external_schema_id_namespace_prefix )"/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:get_object_prefix_from_escaped_prefix_or_not_being_escaped">
|
|
|
+ <xsl:param name="system_cache__appinfo:escape_object_prefix_to_string"/>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" substring-before(system_cache__appinfo:translate_object_escaped_prefix_from_string($system_cache__appinfo:escape_object_prefix_to_string),':')">
|
|
|
+ <xsl:value-of select="system_cache__appinfo:get_object_prefix(system_cache__appinfo:translate_object_escaped_prefix_from_string($system_cache__appinfo:escape_object_prefix_to_string))"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:value-of select="$system_cache__appinfo:escape_object_prefix_to_string"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:get_object_prefix_from_escaped_prefix">
|
|
|
+ <xsl:param name="system_cache__appinfo:escape_object_prefix_to_string"/>
|
|
|
+ <xsl:value-of select="system_cache__appinfo:get_object_prefix(system_cache__appinfo:translate_object_escaped_prefix_from_string($system_cache__appinfo:escape_object_prefix_to_string))"/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <!-- funkcja do wyczyszczenia wyescapowenago prefixu z np. default_db__x3A__IN7_DZIENNIK_KORESP do IN7_DZIENNIK_KORESP -->
|
|
|
+ <xsl:function name="system_cache__appinfo:clean_object_escaped_prefix">
|
|
|
+ <xsl:param name="name" />
|
|
|
+ <xsl:value-of select=" system_cache__appinfo:clean_object_prefix(system_cache__appinfo:translate_object_escaped_prefix_from_string($name))"/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:template name="system_cache__appinfo:prefixed_object_info">
|
|
|
+ <xsl:param name="prefixed_object" required="yes"/>
|
|
|
+ <xsl:variable name="prefix_token" select="tokenize(system_cache__appinfo:translate_object_escaped_prefix_from_string($prefixed_object),':')"/>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" string-length($prefix_token[3]) > 0">
|
|
|
+ <system_cache__appinfo:prefixed_object_info>
|
|
|
+ <xsl:attribute name="prefix" select="$prefix_token[1]"/>
|
|
|
+ <xsl:attribute name="name" select="$prefix_token[2]"/>
|
|
|
+ <xsl:attribute name="element" select="$prefix_token[3]"/>
|
|
|
+ </system_cache__appinfo:prefixed_object_info>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <system_cache__appinfo:prefixed_object_info>
|
|
|
+ <xsl:attribute name="prefix" select="$prefix_token[1]"/>
|
|
|
+ <xsl:attribute name="name" select="$prefix_token[2]"/>
|
|
|
+ <xsl:attribute name="element" select="$prefix_token[2]"/>
|
|
|
+ </system_cache__appinfo:prefixed_object_info>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <!-- @2016-08 funkcje do wykrywania prefixow, namespace itp itd...
|
|
|
+ <xsl:attribute name="prefix" select="$vrtfNamespaces/ns[@uri=$targetnamespace][1]/@prefix" xpath-default-namespace=""/>
|
|
|
+ <xsl:attribute name="targetnamespace" select="$targetnamespace"/>
|
|
|
+ <xsl:attribute name="type_79" select="$type_79"/>
|
|
|
+ <xsl:attribute name="prefix_79" select="$prefix_79"/>
|
|
|
+ <xsl:attribute name="type_79_nopref" select="$type_79_nopref"/>
|
|
|
+
|
|
|
+ -->
|
|
|
+ <xsl:function name="system_cache__appinfo:prefix_from_targetNamespace">
|
|
|
+ <xsl:param name="system_cache__appinfo:vrtfNamespaces" />
|
|
|
+ <xsl:param name="targetNamespace" />
|
|
|
+ <!--<xsl:message>#115 system_cache__appinfo:prefix_from_targetNamespace elements in system_cache__appinfo:vrtfNamespaces=<xsl:value-of select="count($system_cache__appinfo:vrtfNamespaces//ns)" xpath-default-namespace=""/></xsl:message>-->
|
|
|
+ <!--<xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//ns[substring-after(@uri,'://')=substring-after($targetNamespace,'://')][1]/@prefix" xpath-default-namespace=""/>-->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" contains($targetNamespace,'://')">
|
|
|
+ <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//ns[substring-after(@uri,'://')=substring-after($targetNamespace,'://') ][1]/@prefix" xpath-default-namespace=""/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//ns[@uri=$targetNamespace][1]/@prefix" xpath-default-namespace=""/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:prefix_from_targetNamespace">
|
|
|
+ <xsl:param name="system_cache__appinfo:vrtfNamespaces" />
|
|
|
+ <xsl:param name="targetNamespace" />
|
|
|
+ <xsl:param name="system_cache__appinfo:document-uri" />
|
|
|
+ <!--<xsl:message>#115 system_cache__appinfo:prefix_from_targetNamespace elements in system_cache__appinfo:vrtfNamespaces=<xsl:value-of select="count($system_cache__appinfo:vrtfNamespaces//ns)" xpath-default-namespace=""/></xsl:message>-->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" contains($targetNamespace,'://')">
|
|
|
+ <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//ns[substring-after(@uri,'://')=substring-after($targetNamespace,'://') and @system_cache__appinfo:document-uri=$system_cache__appinfo:document-uri][1]/@prefix" xpath-default-namespace=""/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//ns[@uri=$targetNamespace and @system_cache__appinfo:document-uri=$system_cache__appinfo:document-uri][1]/@prefix" xpath-default-namespace=""/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ <xsl:message>#103 targetns another try for <xsl:value-of select="$targetNamespace"/> todo count all <xsl:value-of select="count($system_cache__appinfo:vrtfNamespaces//ns)"/> / <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//node()[local-name()='ns' and @uri=$targetNamespace]/@*"/> </xsl:message>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:targetNamespace_from_prefix">
|
|
|
+ <xsl:param name="system_cache__appinfo:vrtfNamespaces" />
|
|
|
+ <xsl:param name="prefix" />
|
|
|
+ <xsl:value-of select="$system_cache__appinfo:vrtfNamespaces//ns[@prefix=$prefix][1]/@uri" xpath-default-namespace=""/>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:get_default_db_obj_url_table_name"><!-- @2016-10 funkcja do wykrywania nazwy tabeli dla default db, w przypadku braku zgodnosci namespace - nic nie zwraca -->
|
|
|
+ <xsl:param name="parent_complexTypeNamespace" />
|
|
|
+ <xsl:variable name="uri_tokens" select="tokenize($parent_complexTypeNamespace,'/')"/>
|
|
|
+ <xsl:variable name="uri_tokens_count" select="count($uri_tokens)"/>
|
|
|
+ <xsl:if test="$uri_tokens[($uri_tokens_count - 1)]='table' and $uri_tokens[($uri_tokens_count - 2)]='default_db' and $uri_tokens[($uri_tokens_count - 3)]='wfs'">
|
|
|
+ <xsl:variable name="get_default_db_obj_url_table_name" select="tokenize($uri_tokens[$uri_tokens_count],'\.')"/>
|
|
|
+ <xsl:value-of select="$get_default_db_obj_url_table_name[1]"/>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:get_default_db_obj_url_schema"><!-- @2016-10 funkcja do wykrywania nazwy tabeli dla default db, w przypadku braku zgodnosci namespace - nic nie zwraca -->
|
|
|
+ <xsl:param name="parent_complexTypeNamespace" />
|
|
|
+ <xsl:variable name="system_cache__appinfo:get_default_db_obj_url_table_name" select="system_cache__appinfo:get_default_db_obj_url_table_name($parent_complexTypeNamespace)"/>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" string-length($system_cache__appinfo:get_default_db_obj_url_table_name) > 0">
|
|
|
+ <xsl:value-of select="concat($system_cache__appinfo:get_default_db_obj_url_table_name,'.xsd')"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:message>#127 !!!! in (system_cache__appinfo:get_default_db_obj_url_schema) in functions.xsl TODO system objects etc... !!!!!!!!!!! </xsl:message>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:function>
|
|
|
+
|
|
|
+ <xsl:function name="system_cache__appinfo:id.int.rand">
|
|
|
+ <xsl:param name="id"/><!-- like DYSTRYBUCJI___d4e7067-1_ID_PROJECT -->
|
|
|
+ <xsl:variable name="id.int" select="replace($id,'([a-z]|[A-Z]|_|-)','')"/>
|
|
|
+ <xsl:variable name="mod.10" select="(number($id.int)+string-length($id)) mod 10"/>
|
|
|
+ <xsl:variable name="mod.9" select="number($id.int) mod 9"/>
|
|
|
+ <xsl:variable name="mod.8" select="number($id.int) mod 8"/>
|
|
|
+ <xsl:value-of select="concat(1,$mod.10,$mod.9,$mod.8)"/>
|
|
|
+ </xsl:function>
|
|
|
+ <!--<xsl:function name="system_cache__appinfo:php_function_name_from_obj_with_prefix">
|
|
|
+ <xsl:param name="object_name" required="yes"/>
|
|
|
+ <xsl:value-of select="replace($object_name,':','__x3A__')"/>
|
|
|
+ </xsl:function>-->
|
|
|
+
|
|
|
+
|
|
|
+</xsl:stylesheet>
|