| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?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:template match="*" mode="PROCES_TO_DITA_STRIP_HTML"/>
- <xsl:template match="text()" mode="PROCES_TO_DITA_STRIP_HTML">
- <xsl:param name="limit"/>
- <xsl:variable name="parse_content">
- <xsl:choose>
- <xsl:when test=".='
'"/>
- <xsl:otherwise><xsl:call-template name="system_cache__appinfo:escaped_html_to_xml" exclude-result-prefixes="#all" extension-element-prefixes="">
- <xsl:with-param name="html" select="."/>
- </xsl:call-template></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:apply-templates select="$parse_content" mode="CONVERT_HTML_TO_DITA_CONTENT"/>
- </xsl:template>
-
- <xsl:template match="text()" mode="PROCES_TO_DITA_STRIP_HTML_TITLE">
- <xsl:param name="limit"/>
- <xsl:variable name="parse_title">
- <xsl:choose>
- <xsl:when test=".='
'"/>
- <xsl:otherwise><xsl:call-template name="system_cache__appinfo:escaped_html_to_xml" exclude-result-prefixes="#all" extension-element-prefixes="">
- <xsl:with-param name="html" select="."/>
- </xsl:call-template></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:copy-of select="$parse_title"/>
- </xsl:template>
-
- <xsl:template match="*" mode="enter_to_ph">
- <xsl:param name="count"/>
- <xsl:param name="element"/>
- <xsl:variable name="current" select="."/>
- <xsl:variable name="surround_with">
- <xsl:choose>
- <xsl:when test="$element='p'"><xsl:value-of select="'codeblock'"/></xsl:when>
- <xsl:when test="$element='bodydiv'"><xsl:value-of select="'p'"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="'codeblock'"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test=" contains( text(),' ')">
- <xsl:for-each select="tokenize( text(),' ')">
- <xsl:element name="{$surround_with}"><!-- to jest przetwarzane jak jest tekst lamany -->
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$count >1">
- <codeblock>
- <!--<xsl:attribute name="DDxpath" select="@xpath"/>-->
- <!--DN(<xsl:value-of select="$element"/>)-->
- <!--count:<xsl:value-of select="$count"/>-->
- <xsl:copy-of select=" text()"/>
- </codeblock>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="enter_to_ph_text">
- <xsl:with-param name="element" select="$element"/>
- </xsl:apply-templates>
- <!--<xsl:copy-of select=" text()"/>-->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- dodanie enterow dla tabel w ktorych wyrazy sa dluzsze niz 10 znakow -->
- <xsl:template match="text()" mode="enter_to_ph_text">
- <xsl:param name="element" required="yes"/>
- <xsl:choose>
- <xsl:when test="$element='entry'">
- <xsl:for-each select="tokenize(.,' ')">
- <xsl:value-of select="' '"/>
- <xsl:variable name="phrase" select="."/>
- <xsl:for-each select="1 to string-length(.)">
- <xsl:if test="position() mod 12 = 0"><xsl:value-of select="' -'"/></xsl:if>
- <xsl:value-of select="substring($phrase,position(),1)"/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template match="*" mode="dita_content_clean">
- <xsl:value-of select="text()"/>
- <xsl:apply-templates mode="dita_content_clean"/>
- </xsl:template>
- <xsl:template match="text()" mode="dita_content_clean">
- <xsl:value-of select="."/>
- </xsl:template>
-
- </xsl:stylesheet>
|