Re: Disable Output Escaping - really useful

Subject: Re: Disable Output Escaping - really useful
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: Mon, 27 Mar 2000 11:19:06 -0500
/ David Carlisle <davidc@xxxxxxxxx> was heard to say:
| > Anyone know a way of doing this without disable-output-escaping? Is using
| > disable-output-escaping like this a bit of a hack?
| 
| Any use of disable-output-encoding is _always_ a hack.

Sure is. That said, since we're bearing our collective souls
here :-), here's the circumstance where I've used it. Can anyone
suggest a better alternative? :-)

I have a document that contains:

<para>
Some <?Pub _font FontColor="green"?>green<?Pub /_font?> text.
</para>

Which I naturally want to turn into something like this:

<p>
Some <font color="green">green</font> text.
</p>

My current solution uses disable-output-escaping in the obvious
way, but I haven't been able to think of any better solution.
(And the disable-output-escaping solution rises up and bites me 
every now and then if I want to do something with the result-tree
nodes (like squirrel them away in a variable and then xsl:copy them
out later).)

                                        Be seeing you,
                                          norm

P.S. In case anyone asks, yes, I think that "green" really
belongs in a processing instruction in this case (I didn't
design the syntax and I wouldn't have done it quite like that,
but nevermind). The fact that that text is green is utterly
irrelevant to the structure or semantics of the document, it's
purely for presentation. This example comes from a "slides"
doctype that I use for making overheads for talks and
presentations. Sometimes I just want to make a word green.

-- 
Norman Walsh <ndw@xxxxxxxxxx>      | If all mankind were to disappear,
http://nwalsh.com/                 | the world would regenerate back to
                                   | the rich state of equilibrium that
                                   | existed ten thousand years ago. If
                                   | insects were to vanish, the
                                   | environment would collapse into
                                   | chaos.--Edward O. Wilson


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread