xsl-list
[Top] [All Lists]

RE: How to put space between two characters?

2004-04-08 08:31:17
Thanks for your response.Your approach works fine if I
add the table border and cell spacing between
images.But it doesn't works fine if I want to
initialise the table before a word.
Here is the code which will make it more clear,it
works fine and creates the space between the two
images.But the images are shifted in another
line,although I want them to stay in the previous
line.

<xsl:for-each
select="//GrantNet[generate-id(.)=generate-id(key('data',NameOfForm))]">

<xsl:sort select="NameOfForm" order="ascending"/><br/>

<B><strong><font color="#000080"><big><big>
<a name="{generate-id(NameOfForm)}">


<xsl:value-of select="NameOfForm"/>
</a></big></big></font></strong></B>


<xsl:for-each
select="key('data',NameOfForm)"><xsl:text> </xsl:text>
    <xsl:text>  </xsl:text>
<table border="0" WIDTH='200'>

<td width='200'>

<a href="{From_ORSP_Server}"><img alt="DiskBlue.gif"
border="0" height="25" src="DiskBlue.gif"
width="25"/></a><xsl:text>  </xsl:text><xsl:text> 
</xsl:text> <xsl:text>  </xsl:text>  
</td>
<td>

<a href="{From_Granting_Agency}"><img
alt="DiskRed.gif" border="0" height="25"
src="DiskRed.gif" width="25"/></a><br/>
</td>

</table>
<br/><big>Description:</big> <xsl:value-of
select="Description"/><br/><br/><hr/>



</xsl:for-each>


So I added the Table Border and cell spacing before
the NameOfForm,so that I can adjust the table
parameters properly.

<xsl:for-each
select="//GrantNet[generate-id(.)=generate-id(key('data',NameOfForm))]">

<xsl:sort select="NameOfForm" order="ascending"/><br/>

<B><strong><font color="#000080"><big><big>
<a name="{generate-id(NameOfForm)}">

<table border="0" WIDTH='200'>

<xsl:value-of select="NameOfForm"/>
</a></big></big></font></strong></B>


<xsl:for-each
select="key('data',NameOfForm)"><xsl:text> </xsl:text>
    <xsl:text>  </xsl:text>

<td width='200'>

<a href="{From_ORSP_Server}"><img alt="DiskBlue.gif"
border="0" height="25" src="DiskBlue.gif"
width="25"/></a><xsl:text>  </xsl:text><xsl:text> 
</xsl:text> <xsl:text>  </xsl:text>  
</td>
<td>

<a href="{From_Granting_Agency}"><img
alt="DiskRed.gif" border="0" height="25"
src="DiskRed.gif" width="25"/></a><br/>
</td>

</table>
<br/><big>Description:</big> <xsl:value-of
select="Description"/><br/><br/><hr/>



</xsl:for-each>

But it gives an error and says that 'The stylesheet
does not contain a document element. The stylesheet
may be empty, or it may not be a well-formed XML
document'.

Please let me know what is there that I'm doing wrong.
Thanks a million.
Regards,
Puja


--- Pieter Reint Siegers Kort
<pieter(_dot_)siegers(_at_)elnorte(_dot_)com> wrote:
Hi puja,

I just realized that your original question was to
put space between words,
while the answers (including mine) were focused on
images...

Anyway, although you can, there is no real need to
use DOCTYPE, you simply
use   (which is output to the non-braking-space
  equivalent) in
your XSL Stylesheet to separate whatever HTML
elements, like this:
Alternativley, you can use a HTML table, set the
border to '0', and play
with the clellspacing attribute of the <td>
elements, like this:


But note that this approach gives you 10 pixels
AROUND the whole image, an
effect you may not wish to use.

A final approach (IMO, the best) that makes use of
both techniques is to use
a <table> element and add another <td> element
between the two <img>
elements, and fill it with the amount of
non-breaking spaces like this:


Please let us know if this answers your questions.

Cheers, Pieter  


<prs/>
http://www.pietsieg.com
http://www.pietsieg.com/dotnetnuke
Contributor on www.ASPToday.com
Co-author on "Professional ASP.NET XML with C#",
July 2002 by Wrox Press




__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/