Re: Preserve HTML formatting when apply-templates in
> 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 ________________________________________________________________________
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format