|
|
@@ -626,6 +626,7 @@
|
|
|
<xsl:variable name="enter_to_ph">
|
|
|
<xsl:apply-templates mode="enter_to_ph" select="$input_obj_with_xpath/node()[local-name()=current()/@xpath]">
|
|
|
<xsl:with-param name="count" select="count($input_obj_with_xpath/node()[local-name()=current()/@xpath])"/>
|
|
|
+ <xsl:with-param name="element" select="name()"/>
|
|
|
</xsl:apply-templates>
|
|
|
</xsl:variable>
|
|
|
<xsl:copy-of select="$enter_to_ph"/>
|
|
|
@@ -699,27 +700,59 @@
|
|
|
|
|
|
<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(),' ')">
|
|
|
- <codeblock><xsl:value-of select="."/></codeblock>
|
|
|
+ <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>
|
|
|
-<!-- count:<xsl:value-of select="$count"/>
|
|
|
---> <xsl:copy-of select=" text()"/>
|
|
|
+ <!--<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:copy-of select=" text()"/>
|
|
|
+ <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:stylesheet>
|