[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: spaces with SAXON

Subject: Re: spaces with SAXON
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Fri, 6 Aug 1999 14:28:52 -0400 (EST)
saxon newline
At 6 Aug 1999 17:19 +0000, Zsolt Czinkos wrote:
 > I'm using a servlet compiled by SAXON to serve HTML pages.
 > The problem is that:
 > 
 > 1. when i use this with a stylesheet:
 > ...
 > <person>
 > <name>John Smith</name>
 > , <age>23</age>
 > </person>
 > ...
 > 
 > it produces: "John Smith , 23" instead of "John Smith, 23"
...
 > So, SAXON converts a newline to space. Is it a bug?

It is likely that SAXON is producing a newline, which your browser is
displaying as a space.

You are expecting that the newline will be stripped out, but it
shouldn't be.  Section 3.4 of the current WD says, among other things,
that a text node is preserved (i.e. not stripped) if it contains at
least one non-whitespace character.  The text node containing a
newline, a comma character and a space character qualifies as
containing a non-whitespace character, so it isn't stripped.

You could, perhaps, make a template rule that matches on text nodes
and removes a leading newline, but I'd consider fixing the data.

You could try normalize(), but that would also drop the trailing space
character.  You could also try using translate() to strip out just the
newline.

Regards,


Tony Graham
======================================================================
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9632
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.