This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes whitespace... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "whitespace..." Watch "whitespace..." New topic


Sarran Vidyakumar

Joined: Mar 26, 2003
Posts: 28
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"?>
<name>Bugs Bunny </name>
<name>Daisy Duck </name>

Sample XSL File:

<xsl:stylesheet xmlns:xsl="" version="1.0">
<xsl reserve-space elements="name" />
<xsl:template match="/">
<table border="1">
<xsl:for-each select="devguru_staff/programmer">
<xsl:value-of select="name" />
<xsl:value-of select="dob" />
<xsl:value-of select="phone" />
Sarran Vidyakumar

Joined: Mar 26, 2003
Posts: 28
<xsl:value-of select='translate(.," "," ")'/>

solves the prob..
I agree. Here's the link:
subject: whitespace...
It's not a secret anymore!