Subject: Re: [xsl] Trimming (formatting-only) leading tabs/spaces from XSLT - issues? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 07 Jun 2011 11:59:02 -0400 |
Cheers, Wendell
This wouldn't ever be perfect, but there's a large set of rules that could be used to determine formatting-only whitespace. The following set is a distilled version:From the XML context:1. Outside mixed-content 2. Outside where xsl:space "preserve" is in scope 3. Outside defined elements such as 'pre' and 'text' 4. If it precedes an attribute name beginning a new line 5. If it precedes an attribute value on a new lineFrom text context:4. Where the number of characters found are (within a defined margin) is consistent with the current nesting-level - a pattern can normally be established 5. Where irregular leading whitespace is found on consecutive lines in a node value
The approach would be progressive where, on first load a minimal set of 'obvious' formatting is removed, then further options provided to the developer that steadily impose a more rigorous filtering
Phil Fearon http://qutoric
-- ====================================================================== 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 -> |
---|---|---|
Re: [xsl] Trimming (formatting-only, Philip Fearon | Thread | Re: [xsl] Trimming (formatting-only, Philip Fearon |
Re: [xsl] xml:space preserve on ele, Karl Stubsjoen | Date | Re: [xsl] xml:space preserve on ele, David Carlisle |
Month |