How to format text between xsl: text tags?

I have an xslt sheet with text similar to below:

<xsl:text>I am some text, and I want to be bold</xsl:text>

I want some text to be bold, but that doesn't work.

<xsl:text>I am some text, and I want to be <strong>bold<strong></xsl:text>

The deprecated b tag does not work either. How to format text in xsl text tag:

+5
source share
6 answers

No. xsl:textcan contain only text nodes, but <strong>is a node element, not a line starting with a character less than; XSLT is going to create node trees, not markup. So you have to do

<xsl:text>I am some text, and I want to be </xsl:text>
<strong>bold<strong>
<xsl:text> </xsl:text>
+7
source

Try the following:

<fo:inline font-weight="bold"><xsl:text>Bold text</xsl:text></fo:inline>
+4
source

< xsl: text disable-output-escaping = "yes" > <strong> <strong> </XSL: >

+3

XSL-FO , . W3Schools .

0

, , [using disable-output-escaping] - . , w3schools XLS.

, ? , , . , XSL-FO .

0

, , . , , jelovirt

<xsl:text>I am some text, and I want to be </xsl:text>
<strong>bold<strong>
<xsl:text> </xsl:text>

However, if your content is highly formatted, what David Medinetz offers is the best way to do this.

<xsl:text disable-output-escaping="yes">

We have some instructions for printing in the user interface. The instruction set is huge and, of course, we read those from the XML file.

In such cases, the above method is easy to use and supported. This is because the content is provided by technical authors. They do not know XSL. They know the use of HTML tags, and they can easily edit the XML file.

0
source

All Articles