You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stavros Kounis <go...@osmosis.gr> on 2003/05/22 00:29:47 UTC

xsl output give a space after element

hi people

i get a strange space character after img element

i use the follow xsl code

<xsl:template match="osm:div">
	<div>
		<xsl:apply-templates/>
	</div>
</xsl:template>

<xsl:template match="osm:image">
	<img>
		<xsl:attributes>..</xsl:attributes>
		......
		<xsl:attributes>..</xsl:attributes>
	</img>
</xsl:template>

i dont know why but as result of this transformation i get an space
(maybe, im not sure if its a space or something other)
character after <img> that cause aligment and placement problems

whe i try to transform:

<osm:div>
	<osm:image attr1="" attr2="" ../>
</osm:div>

i get

<div><img .....>!</div> where ! is a strange character im not sure if its
a space or not

the problem is that  the height_of_div is greater
than the image_height
even when i define the same values for both so if div has a bg color then
there is a color line (about 5 pixels) under the image

i have try indent=no in xsl:output

has anyone any idea


thnx


--stavros




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: xsl output give a space after element

Posted by Joerg Heinicke <jo...@gmx.de>.
Does it work if you change <xsl:apply-templates/> in the osm:div 
template to <xsl:apply-templates select="*"/>?? Does changing this break 
the normal working of your stylesheet?

Joerg

Stavros Kounis wrote:
> hi people
> 
> i get a strange space character after img element
> 
> i use the follow xsl code
> 
> <xsl:template match="osm:div">
>   <div>
>     <xsl:apply-templates/>
>   </div>
> </xsl:template>
> 
> <xsl:template match="osm:image">
>   <img>
>     <xsl:attributes>..</xsl:attributes>
>     ......
>     <xsl:attributes>..</xsl:attributes>
>   </img>
> </xsl:template>
> 
> i dont know why but as result of this transformation i get an space
> (maybe, im not sure if its a space or something other)
> character after <img> that cause aligment and placement problems
> 
> whe i try to transform:
> 
> <osm:div>
> 	<osm:image attr1="" attr2="" ../>
> </osm:div>
> 
> i get
> 
> <div><img .....>!</div> where ! is a strange character im not sure if its
> a space or not
> 
> the problem is that  the height_of_div is greater
> than the image_height
> even when i define the same values for both so if div has a bg color then
> there is a color line (about 5 pixels) under the image
> 
> i have try indent=no in xsl:output
> 
> has anyone any idea
> 
> thnx
> 
> --stavros


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


[summary] Re: xsl output give a space after element

Posted by Stavros Kounis <go...@osmosis.gr>.
thnx charles

changing the display property of img i have solve the layout problem
now there is not a line under the image

but cocoon still produce the blank character after <img>
this character does not produced when i ask from IE to make the xslt
transformation client side

transformation of the same xml - xsl files give
through cocoon: <div><img ....> </div>
through IE    : <div><img ....><div>

for the moment this does not make any sense but the question is WHY ? is
something that cocoon make different  than Internet Explorer (IE)?


---stavros

On Wed, 21 May 2003, Charles Yates wrote:

> I'm not sure but you may be dealing with the fact that the default
> 'display' property of img elments is 'inline'.  This is what causes the
> line under the image.  If you change the display property to 'block' via
> a style sheet or a style="display:block" attribute it might go away.
>
> Stavros Kounis wrote:
>
> >hi people
> >
> >i get a strange space character after img element
> >
> >i use the follow xsl code
> >
> ><xsl:template match="osm:div">
> >	<div>
> >		<xsl:apply-templates/>
> >	</div>
> ></xsl:template>
> >
> ><xsl:template match="osm:image">
> >	<img>
> >		<xsl:attributes>..</xsl:attributes>
> >		......
> >		<xsl:attributes>..</xsl:attributes>
> >	</img>
> ></xsl:template>
> >
> >i dont know why but as result of this transformation i get an space
> >(maybe, im not sure if its a space or something other)
> >character after <img> that cause aligment and placement problems
> >
> >whe i try to transform:
> >
> ><osm:div>
> >	<osm:image attr1="" attr2="" ../>
> ></osm:div>
> >
> >i get
> >
> ><div><img .....>!</div> where ! is a strange character im not sure if its
> >a space or not
> >
> >the problem is that  the height_of_div is greater
> >than the image_height
> >even when i define the same values for both so if div has a bg color then
> >there is a color line (about 5 pixels) under the image
> >
> >i have try indent=no in xsl:output
> >
> >has anyone any idea
> >
> >
> >thnx
> >
> >
> >--stavros
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> >For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: xsl output give a space after element

Posted by Charles Yates <ce...@stanford.edu>.
I'm not sure but you may be dealing with the fact that the default 
'display' property of img elments is 'inline'.  This is what causes the 
line under the image.  If you change the display property to 'block' via 
a style sheet or a style="display:block" attribute it might go away.

Stavros Kounis wrote:

>hi people
>
>i get a strange space character after img element
>
>i use the follow xsl code
>
><xsl:template match="osm:div">
>	<div>
>		<xsl:apply-templates/>
>	</div>
></xsl:template>
>
><xsl:template match="osm:image">
>	<img>
>		<xsl:attributes>..</xsl:attributes>
>		......
>		<xsl:attributes>..</xsl:attributes>
>	</img>
></xsl:template>
>
>i dont know why but as result of this transformation i get an space
>(maybe, im not sure if its a space or something other)
>character after <img> that cause aligment and placement problems
>
>whe i try to transform:
>
><osm:div>
>	<osm:image attr1="" attr2="" ../>
></osm:div>
>
>i get
>
><div><img .....>!</div> where ! is a strange character im not sure if its
>a space or not
>
>the problem is that  the height_of_div is greater
>than the image_height
>even when i define the same values for both so if div has a bg color then
>there is a color line (about 5 pixels) under the image
>
>i have try indent=no in xsl:output
>
>has anyone any idea
>
>
>thnx
>
>
>--stavros
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org