RE: [xsl] [saxon] unwanted line breaks in HTML output

Subject: RE: [xsl] [saxon] unwanted line breaks in HTML output
From: mark_fletcher@xxxxxxxxxxxxxx
Date: Fri, 9 May 2003 01:07:47 -0700
Thanks, Michael.

Yes, I am producing the output using disable-output-escaping.  I tried
using xsl:attribute, but couldn't get the newlines that I wanted between
each 'opendoc' function argument.  I need these to avoid having amazingly
long lines of parameter text that end up being broken in some javascript
unfriendly way--as opposed to my forcing them to break after each comma.

Believe me, I wish I could pass less information in the onClick attribute,
and I am calling an externally stored function.  But the function I call
requires parameters be passed to it, and the number (and value) of the
parameters varies widely from tag to tag.

So, is it not possible to control where Saxon breaks text nodes?


Mark Fletcher
PeopleSoft Language Engineering
925.694.3753
mark_fletcher@xxxxxxxxxxxxxx



                                                                                                                          
                      "Michael Kay"                                                                                       
                      <mhk@xxxxxxxxx>                   To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx                         
                      Sent by:                          cc:                                                               
                      owner-xsl-list@xxxxxxxxxxx        Subject:  RE: [xsl] [saxon] unwanted line breaks in HTML output   
                      rrytech.com                                                                                         
                                                                                                                          
                                                                                                                          
                      05/09/2003 12:47 AM                                                                                 
                      Please respond to xsl-list                                                                          
                                                                                                                          
                                                                                                                          





Saxon never inserts newlines into HTML attribute values, only into text
nodes.

Perhaps you are producing this output using disable-output-escaping, so
Saxon thinks it is a text node? In that case, I would suggest that you
don't.

Generally I would recommend keeping "onClick" attributes short and
simple - just a call to a Javascript routine that appears somewhere else
in the HTML page. This is because (in my limited experience) browsers
are a bit sensitive to the way characters are represented in these
attributes, and XSLT doesn't give you control over the character
representation.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> mark_fletcher@xxxxxxxxxxxxxx
> Sent: 09 May 2003 00:09
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] [saxon] unwanted line breaks in HTML output
>
>
>
> Is there a default line length that saxon uses to determine
> when to start a
> new line in HTML output?
>
> I'm outputting text inside an onClick tag attribute.  It
> typically looks
> like this, which is what I want (one line per arguement):
>
> <A HREF="javascript:void()" onClick="opendoc(
> escape('Topic One  &#8212;  Maintaining Academic Advisement
> Setup Data'),
> 'htm/lsaa11.htm#d0e13039',
> escape('Topic Two  &#8212;  Maintaining Academic Advisement
> Setup Data'),
> 'htm/lsaa11.htm#d0e13066',
> escape('Topic Three  &#8212;  Using the Analysis Database to Create
> Reports'),
> 'htm/lsaa13.htm#d0e15791',
> escape('Topic Four  &#8212;  Using the Analysis Database to Create
> Widgets'),
> 'htm/lsaa13.htm#d0e15816'
> )">Database Tables Report page</A>
>
> However, if the text inside an escape function is too long, the line
> breaks, like this:
>
> <A HREF="javascript:void()" onClick="opendoc(
> escape('Topic One  &#8212;  This Is Too Much Text and It Breaks Here
> And Causes Problems'),
> 'htm/lsaa11.htm#d0e13039'
> )">Database Tables Report page</A>
>
>
> and I end up with 'unterminated string constant' JavaScript
> errors in the
> browser.  The limit seems to be about 150 characters on the
> line before it
> gets broken at the nearest space.
>
> I can get around this using translate( ) to insert &nbsp; in
> place of every
> space in each string, but I'd rather not if it's avoidable.
>
> Any ideas appreciated!
>
> Mark Fletcher
> PeopleSoft Language Engineering
> 925.694.3753
> mark_fletcher@xxxxxxxxxxxxxx
>
>
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


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









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


Current Thread