|
|
@@ -1,19 +1,72 @@
|
|
|
<?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:p5_tr_map="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd"
|
|
|
+ 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:param name="namespace_prefix" required="yes"/>
|
|
|
<xsl:output indent="yes" />
|
|
|
<xsl:strip-space elements="*"/>
|
|
|
|
|
|
+ <xsl:template match="p5_tr_map:go_recurse_from_root_by_build_element">
|
|
|
+ <RelatedFeature>
|
|
|
+ <xsl:attribute name="xpath" select="'ID'"/>
|
|
|
+ <!-- wykrycie pierwszego @local-name-name -->
|
|
|
+ <xsl:apply-templates mode="detect_typeName_tr_map"/>
|
|
|
+
|
|
|
+ <xsl:apply-templates/>
|
|
|
+ </RelatedFeature>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="p5_tr_map:go_recurse_from_root_by_build_element_477">
|
|
|
+ <RelatedFeature>
|
|
|
+ <xsl:attribute name="xpath" select="'ID'"/>
|
|
|
+ <!-- wykrycie pierwszego @local-name-name -->
|
|
|
+ <xsl:apply-templates mode="detect_typeName_tr_map"/>
|
|
|
+
|
|
|
+ <xsl:apply-templates/>
|
|
|
+ </RelatedFeature>
|
|
|
+ </xsl:template>
|
|
|
|
|
|
<xsl:template match="*">
|
|
|
<xsl:element name="{name()}">
|
|
|
- <xsl:copy-of select="@*"/>
|
|
|
- <xsl:attribute name="xml_id" select="generate-id()"/>
|
|
|
+ <xsl:apply-templates select="@*">
|
|
|
+ <xsl:with-param name="element" select="name()"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@system_cache__appinfo:id">
|
|
|
+ <xsl:attribute name="xml_id" select="@system_cache__appinfo:id"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:attribute name="xml_id" select="generate-id()"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ <!--<xsl:attribute name="xml_id" select="generate-id()"/>-->
|
|
|
<xsl:apply-templates/>
|
|
|
</xsl:element>
|
|
|
</xsl:template>
|
|
|
|
|
|
+ <xsl:template match="@create_element">
|
|
|
+ <xsl:attribute name="xpath" select="."/>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="@*">
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template mode="detect_typeName_tr_map" match="*">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@local-name-name">
|
|
|
+ <xsl:attribute name="typeName" select="concat($namespace_prefix,':',@local-name-name)"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:apply-templates mode="detect_typeName_tr_map"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
</xsl:stylesheet>
|