Вопрос по – Как реализовать возврат каретки в XSLT

21

Я хочу реализовать возврат каретки в xslt. Проблема у меня есть переменная: Шаг 1 = значение 1 breaktag. Шаг 2 = Значение 2 в виде строки, которое должно отображаться как

Шаг 1 = Значение 1

Шаг 2 = Значение 2

в форме HTML, но я получаю тег br на странице. Любые хорошие способы реализации перевода строки / возврата каретки в xsl приветствуются

Error: User Rate Limit Exceededstackoverflow.com/questions/723226/producing-a-new-line-in-xslt Coder

Ваш Ответ

9   ответов
0

Error: User Rate Limit Exceeded

7

Error: User Rate Limit Exceeded

<xsl:text>&#xD;&#xA;</xsl:text>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededCRLFError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
1

Error: User Rate Limit Exceeded&#10;Error: User Rate Limit Exceeded&#10;Error: User Rate Limit Exceeded&#10;Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

<xsl:call-template name="MultilineTextOutput">
    <xsl:with-param name="text" select="@ActivityExtDescription" />
</xsl:call-template>

Error: User Rate Limit Exceeded

<xsl:template name="MultilineTextOutput">
<xsl:param name="text"/>
<xsl:choose>
    <xsl:when test="contains($text, '&#10;')">
        <xsl:variable name="text-before-first-break">
            <xsl:value-of select="substring-before($text, '&#10;')" />
        </xsl:variable>
        <xsl:variable name="text-after-first-break">
            <xsl:value-of select="substring-after($text, '&#10;')" />
        </xsl:variable>

        <xsl:if test="not($text-before-first-break = '')">
            <xsl:value-of select="$text-before-first-break" /><br />
        </xsl:if>

        <xsl:if test="not($text-after-first-break = '')">
            <xsl:call-template name="MultilineTextOutput">
                <xsl:with-param name="text" select="$text-after-first-break" />
            </xsl:call-template>
        </xsl:if>
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="$text" /><br />
    </xsl:otherwise>
</xsl:choose>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
3

Error: User Rate Limit Exceeded

<xsl:text><![CDATA[<br />]]></xsl:text>
0

Error: User Rate Limit Exceeded &#10Error: User Rate Limit Exceeded\r\n

0

Error: User Rate Limit Exceeded

<xsl:text>
</xsl:text>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded chugh97
4

Error: User Rate Limit Exceeded

<xsl:text>
</xsl:text>
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded chugh97
42

Error: User Rate Limit Exceeded

<xsl:text>
</xsl:text>

Error: User Rate Limit Exceeded

<xsl:text>&#10;</xsl:text> <!-- newline character -->

Error: User Rate Limit Exceeded

<xsl:text>&#13;</xsl:text> <!-- carriage return character -->

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded chugh97
Error: User Rate Limit Exceeded
3

Error: User Rate Limit Exceeded

<xsl:variable name="newline"><xsl:text>&#10;</xsl:text></xsl:variable>
<xsl:value select="concat(some_element, $newline)" />

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededxsl:textError: User Rate Limit Exceededxsl:variableError: User Rate Limit ExceededselectError: User Rate Limit Exceeded<xsl:variable name="newline" select="'&#10;'"/>Error: User Rate Limit Exceeded

Похожие вопросы