Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 29th, 2011, 03:57 AM
Registered User
 
Join Date: Nov 2011
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default vAlign/Align attribute for TD not working

Hi,

I am working on a table and using the below code to generate a TD element with attributes.

Code:
<xsl:element name="TD">
				<xsl:attribute name="valign">
					<xsl:value-of select="Top"/>
				</xsl:attribute>
				<xsl:attribute name="Width">
					<xsl:value-of select="../../../@colwidth"/>%
				</xsl:attribute>
blah.....blah.....blah......
</xsl:element>


The width attribute is working fine, but align/valign attribute is not working. Say like, i have given valign as "top" in the above example, but still in my output table the data is coming in "middle". The same issue for align attribute if i assign left/right.

Any idea whats going on here?
 
Old November 29th, 2011, 04:34 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

<xsl:value-of select="Top"/> will select the textual value of the <Top> element. I'm guessing you actually want to ouput the string 'Top' instead.

Try <xsl:value-of select="'Top'"/>.

Better still, get rid of the <xsl:element> and <xsl:attribute> instructions and do it like this:

Code:
<TD valign="Top" width="{../../../@colwidth}%">
  ... blah blah blah
</TD>
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old December 10th, 2011, 02:23 AM
newocean121
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by samjudson View Post
<xsl:value-of select="Top"/> will select the textual value of the <Top> element. I'm guessing you actually want to ouput the string 'Top' instead.

Try <xsl:value-of select="'Top'"/>.

Better still, get rid of the <xsl:element> and <xsl:attribute> instructions and do it like this:

Code:
<TD valign="Top" width="{../../../@colwidth}%">
  ... blah blah blah
</TD>
that's right! thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
copy-namespaces attribute not working? ebaerwald XSLT 10 September 7th, 2010 11:10 AM
verticle-align:middle not working kanoorani CSS Cascading Style Sheets 0 April 27th, 2009 01:52 AM
Align to right not working Cyber Shiva HTML Code Clinic 4 July 19th, 2007 01:49 PM
EASY Q: Left-Align and Right-Align DIV? panuvin ASP.NET 1.0 and 1.1 Basics 0 December 16th, 2006 02:02 AM
XML to EXCEL ATTRIBUTE NOT WORKING pallone XSLT 4 September 7th, 2006 02:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.