homepage Welcome to WebmasterWorld Guest from 54.227.40.166
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
XSLT White Space Gaps Under Images
XSLT White Space Gaps Under Images
NZ_Mark




msg:702011
 8:56 pm on Sep 2, 2004 (gmt 0)

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 (simplified) 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?

 

irnbru




msg:702012
 3:06 pm on Sep 3, 2004 (gmt 0)

Which xslt processor are you using?

choster




msg:702013
 3:30 pm on Sep 3, 2004 (gmt 0)

Check your <xml:output> statement. If your output method is "xml" or "html," and you have indent="yes", processors will output the tree as an indented hierarchy, each tag on its own line. The default is supposed to be indent="no".

More fundamentally, why are you including a closing tag for <img>, an empty element? Browsers' methods of handling or ignoring an invalid HTML tag are outside the domain of XSLT.

macrost




msg:702014
 12:30 am on Sep 4, 2004 (gmt 0)

In xsl, you do have to close empty elements also, otherwise the transformation will fail as the processor will burp over it.

I'm not sure about the 2px gap, try the indet if you are doing xml output.

NZ_Mark




msg:702015
 8:48 pm on Sep 5, 2004 (gmt 0)

Thanks,
The indent="no" works just fine, problem solved.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved