RE: [xsl] Preserve HTML formatting when apply-templates in variabl

Subject: RE: [xsl] Preserve HTML formatting when apply-templates in variabl
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Aug 2004 08:59:50 -0700
Thanks David!

And may I give a

			** SHOUT **

out to all those who respond on this list; I am continuolsy amazed by the
collective wealth of knowledge brewing here.  It sums up to pure genius.

	** THANK YOU ALL!  YOU ARE ALL AWESOME!!  **

Karl



-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Friday, August 06, 2004 8:35 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Preserve HTML formatting when apply-templates in
variabl



> Can you think of a sensible use of "disable-output-escaping"?

4 off the top of my head:


a)
creating almost-but-not-quite XML like some template languages

<% .... %>

(ASP JSP etc)

As that isn't legal XML, XSLT won't generate it without a bit of from
d-o-e.

b)
Generating a local subset of a doctype, and entity references, if you
_really_ have to.

c)
In the MathML specification we use CDATA sections for mathml examples.
We don't just "inline" the XML which is the usual advice as we want
tight control over things like indentation and use of ' or " around
attribute values. If you are telling the user that they can do a="2" or
a='2' you don't want the system to write them both out the same way:-)
In the normative  html version of the spec it's no problem you just
value-of the example into a <pre> and it all works, but  in the
XHTML+MathML version we _also_ want to inline it as XML so you get a
side-by-side view of the literal XML and how your browser renders it,
we use d-o-e to produce this.

d) If you have quoted html inside your xml as in
 <foo><![CDATA[ a <br> c <img src= "x.png"> jjj ]]></foo>
and you need that html in the output. If you can fix your input not to
do that it is good but often you can't (RSS feeds etc) and so d-o-e can
be used as a method of last resort (although xslt2 offers alternatives,
more on that another day perhaps:-)(


David



________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread