vertical alignment - XSL-FO : How to make value expand vertically -
vertical alignment - XSL-FO : How to make value expand vertically -
i've got name string in xml length varies. in case of long name, expands horizontally cannot afford. how can create grow vertically? below have.
<fo:table-cell font-family="courier" font-size="10px" display-align="before"height="0.01042in" border-style="solid" border-color="green"> <fo:block padding-top="1pt" padding-bottom="1pt" borderstyle="solid"> <fo:inline> <xsl:text>user information</xsl:text> </fo:inline> <fo:block> <xsl:text>
</xsl:text> </fo:block> <fo:inline font-family="courier" font-size="12px" font-weight="bold"> <xsl:value-of select="username" /> </fo:inline> </fo:block> </fo:table-cell>
i used link posted joel above in comments. when applied template exactly, displayed strings odd length fine missed lastly character of length strings. changed comparing less than<
less or equal<=
, worked. hope help someone.thanks.
<xsl:template name="zero_width_space_1"> <xsl:param name="data" /> <xsl:param name="counter" select="0" /> <xsl:choose> <xsl:when test="$counter <= string-length($data)"> <xsl:value-of select='concat(substring($data,$counter,1),"​")' /> <xsl:call-template name="zero_width_space_2"> <xsl:with-param name="data" select="$data" /> <xsl:with-param name="counter" select="$counter+1" /> </xsl:call-template> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="zero_width_space_2"> <xsl:param name="data" /> <xsl:param name="counter" /> <xsl:value-of select='concat(substring($data,$counter,1),"​")' /> <xsl:call-template name="zero_width_space_1"> <xsl:with-param name="data" select="$data" /> <xsl:with-param name="counter" select="$counter+1" /> </xsl:call-template> </xsl:template> <xsl:call-template name="zero_width_space_1"> <xsl:with-param name="data" select="mystring" /> </xsl:call-template>
vertical-alignment xsl-fo
Comments
Post a Comment