File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!