Skip to Content
XSLT
book

XSLT

by Doug Tidwell
August 2001
Intermediate to advanced
480 pages
11h 16m
English
O'Reilly Media, Inc.
Content preview from XSLT

How Do I Generate Some Text?

You can generate text in your output in several different ways. The simplest way is to use the <xsl:text> element. This element generates text to the output stream automatically. The <xsl:text> element is often necessary because many elements in the XSLT vocabulary can’t contain text.

A second way is to use the <xsl:value-of> element with various string functions. Say we’re going to generate a string that is the concatenation of several items in the current context. Combining <xsl:value-of> with the concat() function allows us to do this. Here’s an example:

<xsl:value-of select="concat('abc ', 'easy as ',123)"/>

This element is replaced with the text “abc easy as 123.”

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning XSLT

Learning XSLT

Michael Fitzgerald
Inside XSLT

Inside XSLT

Steven Holzner
XSLT Cookbook

XSLT Cookbook

Sal Mangano

Publisher Resources

ISBN: 0596000537Supplemental ContentCatalog PageErrata