Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

whitespace...

 
Sarran Vidyakumar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guyz:
on transformation the whitespace is lost..I need the output in the table to show the spaces after name..I tried the <xsl reserve-space elements="name" /> but it still strips off the spaces..any suggestions..Thanks....


sample XML File:

<?xml version="1.0" encoding="UTF-8"?>
<devguru_staff>
<programmer>
<name>Bugs Bunny </name>
<dob>03/21/1970</dob>
<phone>865-111-1111</phone>
</programmer>
<programmer>
<name>Daisy Duck </name>
<dob>08/09/1949</dob>
<phone>865-222-2222</phone>
</programmer>
</devguru_staff>

Sample XSL File:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl reserve-space elements="name" />
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each select="devguru_staff/programmer">
<tr>
<td>
<xsl:value-of select="name" />
</td>
<td>
<xsl:value-of select="dob" />
</td>
<td>
<xsl:value-of select="phone" />
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
 
Sarran Vidyakumar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<xsl:value-of select='translate(.," "," ")'/>

solves the prob..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic