Code: Select all
<msg>
<msgId>
<msgNumber>1234567</msgNumber>
</msgId>
<msgText>The variations of this message are explained below. <?linebreak?> -option one. <?linebreak?> -option two.
</msgText>
</msg>
-----------------------------------------------------------------
1234567 The variations of this message are explained below.
-option one.
-option two.
I’ve managed to force the line breaks and indent the subsequent lines, BUT where any segment of msgText is long enough to wrap to the next line, the wrapped portion is not indented…
-----------------------------------------------------------------
1234567 The variations of this message are explained below. This
part wraps and needs to be indented.
-option one. When these segments are long enough to wrap
this part wraps and needs to be indented.
-option two.
Here’s the code I have that makes it work to the extent it does:
Code: Select all
<xsl:template match="*[contains(@class, ' msg/msgText ')]">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="processing-instruction()[name() = 'linebreak']">
<!-- This forces a linebreak by filling an entire line with non-breaking-spaces, and tacking on
a normal space to allow content that follows to wrap to the next line. -->
<text>
<xsl:for-each select="1 to $LINELENGTH"> </xsl:for-each>
<xsl:text> </xsl:text>
</text>
<!-- This indents the first line of the next segment of msgText. -->
<text>       </text>
</xsl:template>
Any thoughts, ideas, lifelines gratefully accepted. Thanks!