473,467 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

controlling whitespace with output method=html

Hi,

I was wondering if there is any way to control the whitespace (specifically
line breaks) that are generated using Xalan XSLT processor with output
method=html.

I find it sometimes generates a line feed character before a <br>, even
where I have no whitespace between the <br /> and the next HTML tag in my
xsl. This wouldn't normally be a problem but it seems that sometimes this
upsets IE and causes it to put an extra blank line in the HTML page.

Andy
Jul 20 '05 #1
2 1770
In article <ab*********************@news-text.cableinet.net>,
Andy Fish <aj****@blueyonder.co.uk> wrote:

% I was wondering if there is any way to control the whitespace (specifically
% line breaks) that are generated using Xalan XSLT processor with output
% method=html.

In general, if you put all literal text in xsl:text elements, the processor
will spit out only what you tell it to. If you emit literal text which is
not wrapped up in xsl:text, the processor will typically emit all the text
nodes in the same template, including the new-lines. This may be the
problem you're having.

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #2

"Patrick TJ McPhee" <pt**@interlog.com> wrote in message
news:ca**********@news.eusc.inter.net...
In article <ab*********************@news-text.cableinet.net>,
Andy Fish <aj****@blueyonder.co.uk> wrote:

% I was wondering if there is any way to control the whitespace (specifically % line breaks) that are generated using Xalan XSLT processor with output
% method=html.

In general, if you put all literal text in xsl:text elements, the processor will spit out only what you tell it to. If you emit literal text which is
not wrapped up in xsl:text, the processor will typically emit all the text
nodes in the same template, including the new-lines. This may be the
problem you're having.

the problem I'm having is that even when I jam up the HTML fragment in the
xsl file with no whitespace at all, it still comes out with line breaks in.
Normally this wouldn't matter with HTML but in this specific case it is
making a difference to the way IE renders the page.

however, the <xsl:text> did provide a workaround. I replaced <br> with

<xsl:text>&lt;br&gt;</xsl:text>

and now the extra whitespace is gone. It seems like an ultra-bodge but there
are only a couple of places I need to use it so I'll have to be pragmatic
about it.

Thanks

Andy
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: andy.t.chou | last post by:
I need to be able to have a hidden field (signiture) with each output html file generated. # (Get the first and last name from the html form) $first_name = $q->param('FirstN'); $last_name =...
1
by: Tom Gao | last post by:
Hi guys I want to export html out of an aspx page.. how can I do this ? any help is appreciated Thanks Tom
5
by: Mainard | last post by:
Hi, all First off I know alittle about javascript, but i have never worked with controlling froms with it be for i wonder can some help me? for example:I have this <textarea name"write1">Write...
0
by: Mads | last post by:
Hi, I'm transforming a XML doc with XSLTransform into a StringWriter, which I then write via the Response.Write(StringWrite.ToString()) to a web page. The problem is that during the process it...
1
by: John | last post by:
I am trying to get a control to insert into the HTML content for a page which comes from our database. At the point I have a tag for the component I want to add which is contained inside the HTML....
4
by: Matthew Cox | last post by:
Hi, I've been searching the net all day today trying to figure out how one would accomplish what I originally thought would be a fairly straight forward and simple thing. The problem I'm trying...
3
by: Smithers | last post by:
Just wondering what it would take to cache a copy of the output HTML from a dynamically constructed aspx page before it is sent to the browser. Reason being: the page is constructed of a few user...
4
by: maria | last post by:
I only use C++ with Visual Studio 6.0 for string manipulations in thousands of HTML pages on my website. Many times, the output files of many of my C++ programs contain a spanish question mark (¿)...
1
Haitashi
by: Haitashi | last post by:
Hi guys! First off let me explain that I know it's not possible to output html in a text area and expect it to appear rendered. =) I'm trying to come up with a solution. Basically, I...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.