473,386 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

XSLT White Space Gaps Under Images


Hi,
When transforming an XSLT to HTML I get a very annnoying white spac
gap of about 2px under each image. This is particularly annoying as
am creating a vertical navigation menu made up of images wit
rollovers. I know why the space is there, I just dont know how t
remedy the problem in my XSLT. The space is caused by the transforme
HTML closing </a> being on the next line from the closing </img> ta
and the closing </td> on the next line again. Even if I line everythin
up on the same line in the source XSLT it jumps down again when it i
transformed to HTML.

The XSLT code is pretty simple:

<td><a>
<xsl:attribute name="href">
<xsl:value-of select="$VirPath" />default.aspx
</xsl:attribute>
<img name="ImageName" src="Image.gif>
</img></a></td>

How can I force the transformed HTML to line up properly so I dont ge
this 2px gap under my images
-
Mark24
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message115162.htm

Jul 20 '05 #1
1 2337
Hi Mark,

To take tight control of the whitespace produced by your transformation...
1. Make sure your output method is HTML and turn indentation off, e.g.
<xsl:output method="html" indent="no"/>

2. Ensure that all implicit output text is made explicit - implicit output
text being text that is not wrapped within <xsl:text>, e.g.
convert things like...
<p>Something</p>
to...
<p>
<xsl:text>Something</xsl:text>
</p>

Also, don't use <xsl:attribute> when an AVT (attribute value template) would
suffice, e.g. rather than...
<td>
<a>
<xsl:attribute name="href">
<xsl:value-of select="$VirPath" />default.aspx
</xsl:attribute>
<img name="ImageName" src="Image.gif></img>
</a>
</td>
use instead...
<td>
<a href="{$VirPath}default.aspx">
<img name="ImageName" src="Image.gif"/>
</a>
</td>
HTH
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator
"Mark247" <Ma************@mail.forum4designers.com> wrote in message
news:Ma************@mail.forum4designers.com...

Hi,
When transforming an XSLT to HTML I get a very annnoying white space
gap of about 2px under each image. This is particularly annoying as I
am creating a vertical navigation menu made up of images with
rollovers. I know why the space is there, I just dont know how to
remedy the problem in my XSLT. The space is caused by the transformed
HTML closing </a> being on the next line from the closing </img> tag
and the closing </td> on the next line again. Even if I line everything
up on the same line in the source XSLT it jumps down again when it is
transformed to HTML.

The XSLT code is pretty simple:

<td><a>
<xsl:attribute name="href">
<xsl:value-of select="$VirPath" />default.aspx
</xsl:attribute>
<img name="ImageName" src="Image.gif>
</img></a></td>

How can I force the transformed HTML to line up properly so I dont get
this 2px gap under my images?

--
Mark247
------------------------------------------------------------------------
Posted via http://www.forum4designers.com
------------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message115162.html

Jul 20 '05 #2

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

Similar topics

3
by: joeblack | last post by:
Elements like <textarea> must be in form of <textarea ...></textarea> instead of <textarea .../>. How to do it or reserve a white space for it in XSLT tranformation. Thanks a lot
5
by: David Blickstein | last post by:
I'm finding it difficult to determine when/where XSLT generates line breaks when generating a text file <xsl:output method="text" media-type="text/plain"/> And... I'm getting thoroughly...
45
by: Stephen Poley | last post by:
People in these groups, and on web-pages, not infrequently suggest that it is worthwhile cutting down on white-space and comments in HTML and CSS in order to reduce loading times. I and others have...
5
by: Applebrown | last post by:
Hello, basically, I'm just learning intermediate CSS and trying to convert my old table webpage completely to CSS. Hoorah, right? Well, it's not quite going as planned. It's an extremely simple...
2
by: FrankStallone | last post by:
I am just getting started in XML and I made my first xml, dtd and xslt file and XML spy said they were all valid and they worked. This was the xslt doc that worked. <?xml version="1.0"...
0
by: Brendan Reynolds | last post by:
I have a web service that takes the XML representation of a dataset and uses XSLT to transform it to the format required to open a disconnected ADODB recordset on the XML, and returns the...
1
by: neverstill | last post by:
hi- I have a table on a page there is 1 row and 2 cells cell 1 has a user control that is basically just a DataList nested in a table o fit's own. then, below that user control I have some <p>...
4
by: dwergkees | last post by:
Hi, Got a litte problem here. I'm trying to create a XSLT file that will do a transformation from WordML format (MS Word XML format, see...
4
by: Don Miller | last post by:
When an ASP.NET 2.0 web page is rendered with multiple web controls hidden from view (.visible=false) there is a noticeable gap between a rendered element (like a table) and the next visible...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.