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 June 27th, 2007, 12:22 AM
Authorized User
 
Join Date: Jun 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default space in between name and time

my xsl file is
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Dt">
<html>
  <body>
  <xsl:for-each select="*">

      <xsl:value-of select="name()"/>
      <xsl:value-of select="@Time"/><br />
     <xsl:value-of select="."/><br />


  </xsl:for-each>
</body>
  </html>
</xsl:template>

</xsl:stylesheet>
and my output is
sree10:31:12
hi
you11:32:15
sd

actually wht i need is
sree 10:31:12
hi
you 11:32:!5
sd
i want to insert space in between name and time
thank u
sree

 
Old June 27th, 2007, 01:23 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Use <xsl:text> </xsl:text>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 3rd, 2007, 11:29 PM
Authorized User
 
Join Date: Jun 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it's not working actually wht i need is
sreee(extreme left) and time in(extreme right)
sree 10:13:13
thank u



 
Old July 4th, 2007, 02:21 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Then you will have to calculate the number of spaces you need - use the string-length() function and the subtraction operator "-", and output the number of spaces as xsl:value-of select="substring($manySpaces, 1, $n)" where $manySpaces is a string of lots of spaces and $n is the number of spaces you want to output.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
synchronizing pocket pc time with desktop time bobbyrayudu83 C# 1 April 2nd, 2011 04:28 AM
Time Shift time in minus time out lechalas Beginning VB 6 1 August 11th, 2008 01:56 PM
Looks like a space but it isn't. rstelma SQL Server 2000 3 September 7th, 2005 07:17 PM
Using xs:time to generate time in desired format krayan001 XSLT 0 June 27th, 2005 04:28 PM
space crmpicco Javascript How-To 1 February 7th, 2005 01:26 PM





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