This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
search-replace linefeeds
- From: Ethan Vaughn <ethan at gurulabs dot com>
- To: docbook at lists dot oasis-open dot org
- Date: Tue, 04 Feb 2003 18:07:42 -0700
- Subject: DOCBOOK: search-replace linefeeds
- Organization: GuruLabs
i'm trying to translate a <screen> block into an html table but can't figure
out how to get the linefeed replaced by an html tag (like </td>). Maybe i'm
just going at it all wrong. Here's a sample of the xml:
<screen>
<prompt># </prompt><userinput><command>telnet</command></userinput>
Trying 192.168.0.1...
Connected to 192.168.0.1
</screen>
To test it i'm trying to search linefeeds out of the content and replace with
<br>. My goal however is to be able to translate each line into an HTML table
row so i can tag certain lines with callouts. Anyway, that's not the issue
(yet).
The problem is that i call a "search-replace" template with params and use
substring-after() to recusively chunck through the string at each linefeed.
This works. If my "replace" string is "m" as an arbitrary example, the HTML
is:
m# telnetmTrying 192.168.0.1...mConnected to 192.168.0.1m
I've tried to get <br> in there but can't figure out how to tell the
with-param to do it = "won't accept "unescaped" '<' , etc ,etc
The closest i come is this:
<xsl:with-param name="replace-string">
<xsl:value-of select="'<br>'"/>
</xsl:with-param>
which of course just sticks a bunch of literal <br> in the html document. i've
tried select="<br>", select="'<br>'", select="<br>"
Any ideas?
--------------------------------------
Ethan Vaughn
ethan@gurulabs.com
--------------------------------------