Subject: Re: [xsl] preserve structure of input XML file From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 17 May 2011 11:35:32 -0400 |
I need to preserve all the whitespace and structure of an input XML file. How do I do that in XSLT? I tried using fixed width fonts like monospace but that does not work.
Some basic rules of thumb if you want whitespace preserved: * Don't use MSXML or another processor known to discard whitespace * Don't use xsl:strip-space (which strips whitespace from the source) or xsl:output/@indent='yes' (which adds it in serialization) * Don't use a schema for your input, or if you do (in XSLT 2.0) make sure your processor is set to leave whitespace alone * Don't add whitespace in your templates
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] preserve structure of input X, a kusa | Thread | Re: [xsl] preserve structure of inp, Richard Fozzard |
[xsl] preserve structure of input X, a kusa | Date | Re: [xsl] preserve structure of inp, Richard Fozzard |
Month |