Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSLT White Space Gaps Under Images

Reply
Thread Tools

XSLT White Space Gaps Under Images

 
 
Mark247
Guest
Posts: n/a
 
      09-02-2004

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

 
Reply With Quote
 
 
 
 
Marrow
Guest
Posts: n/a
 
      09-02-2004
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.
<xslutput 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" <(E-Mail Removed)4designers.com> wrote in message
news:(E-Mail Removed)4designers.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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any programs to trim white space/ remove all white space in HTML file? Ben C HTML 6 01-28-2007 11:41 PM
How to reserve white space for a particular element in XSLT joeblack XML 3 11-04-2003 02:07 AM
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments