Re: [xsl] white space prob

Subject: Re: [xsl] white space prob
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 17 Oct 2001 17:15:24 -0400
Yan,

You're in trouble. An XML parser will normalize space in attributes; this will prevent you from getting what you want. Check out the XML Rec, section 3.3.3. The bottom line is, that your carriage returns will be replaced with spaces (&#32;). The XSL Processor never even gets to see the line feed character, much less preserve it.

It's the first time I've ever seen this requirement of attribute values, though ... this is why there's xml:space for text content of elements.

Tortuous workarounds are possible, but they involve pre- and post-processing your data with a non-XML-aware processor such as a Perl script or such like.

Sorry,
Wendell

At 03:15 PM 10/17/01, you wrote:
I have a tag with an attribute like this:
<tagX
col1="a.  Here are some additional info:

        (i)   some info X.
        (ii)  some info Y.
        (iii) some info Z.

b. Here is the second part info.">

I want to transform this into:
<col1>
a.  Here are some additional info:

        (i)   some info X.
        (ii)  some info Y.
        (iii) some info Z.

 b.  Here is the second part info.
</col1>

I want to keep all white space just like before.  Or
do I need escaping for white space and new line?

Thanks in advance.

Yan


======================================================================
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
======================================================================


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



Current Thread