473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Unwanted whitespace after xsl:value-of when using fop

Hi,

I've browsed the Fop FAQ, usenet and the internet hoping to find a
solution to my problem, but in vain.

I am using Xerces 2.6.2, Xalan-J 2.6.0 and Fop 0.20-5 to create
PDF-documents. In the rendered PDF there is an unwanted whitespace
after each xsl:value-of.

An example: What I want to render to "Doe, John" renders to "Doe ,
John".

At least in the Nordic languages this looks wrong. Here is my XSL and
my XML:

XSL:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:call-template name="mastersetup"/>
<xsl:apply-templates/>
</fo:root>
</xsl:template>
<xsl:template name="mastersetup">
<fo:layout-master-set>
<fo:simple-page-master master-name="a4"
page-height="297.00mm"
page-width="210.00mm"
margin-top="0.00mm"
margin-bottom="0.00mm"
margin-left="0.00mm"
margin-right="0.00mm">
<fo:region-before
margin-top="0.00mm"
margin-bottom="0.00mm"
margin-left="0.00mm"
margin-right="0.00mm"/>
<fo:region-body
margin-top="45.00mm"
margin-bottom="10.00mm"
margin-left="35.00mm"
margin-right="10.00mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
</xsl:template>
<xsl:template match="Person">
<fo:page-sequence master-reference="a4">
<fo:static-content flow-name="xsl-region-before">
<fo:block-container background-color="transparent"
border-style="solid"
border-width="0.00mm"
border-color="#000000"
position="absolute"
left="30.00mm"
top="30.00mm"
width="100.00mm"
height="5.00mm"
padding-top="0.00mm"
padding-left="0.00mm"
padding-right="0.00mm"
padding-bottom="0.00mm"
text-align="start"
line-height="10pt"
font-family="Helvetica"
color="#000000"
font-size="8pt"
font-style="normal"
font-weight="normal">
<fo:block>
<xsl:value-of select="LastName"/>, <xsl:value-of
select="FirstName"/>
</fo:block>
</fo:block-container>
<fo:block/>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block/>
</fo:flow>
</fo:page-sequence>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

XML:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Person>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
</Person>

Have anyone experienced the same? Is this a known bug? Is it a
feature? I would be grateful if anyone have a solution to my problem.

Regards
Brynjar Glesnes
Jul 20 '05 #1
3 1988


Brynjar Glesnes wrote:

<fo:block>
<xsl:value-of select="LastName"/>, <xsl:value-of
select="FirstName"/>


Try whether
<xsl:value-of select="LastName" /><xsl:text>,
</xsl:text><xsl:value-of select="FirstName" />
improves things.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Martin Honnen <ma*******@yahoo.de> wrote in message news:<41**********************@newsread4.arcor-online.net>...
Brynjar Glesnes wrote:

<fo:block>
<xsl:value-of select="LastName"/>, <xsl:value-of
select="FirstName"/>


Try whether
<xsl:value-of select="LastName" /><xsl:text>,
</xsl:text><xsl:value-of select="FirstName" />
improves things.


Thank you for your answer. Unfortunately this made no difference.

Brynjar
Jul 20 '05 #3
In article <69**************************@posting.google.com >,
Brynjar Glesnes <br*************@entragroup.com> wrote:
% Martin Honnen <ma*******@yahoo.de> wrote in message
% news:<41**********************@newsread4.arcor-online.net>...
% > Brynjar Glesnes wrote:
% >
% >
% > > <fo:block>
% > > <xsl:value-of select="LastName"/>, <xsl:value-of
% > > select="FirstName"/>
% >
% > Try whether
% > <xsl:value-of select="LastName" /><xsl:text>,
% > </xsl:text><xsl:value-of select="FirstName" />
% > improves things.
%
% Thank you for your answer. Unfortunately this made no difference.

It looks to me like there's white-space in the data of your LastName
element. Try

<xsl:value-of select="normalize-space(LastName)"/>,

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kevin Dean | last post by:
I'm trying to create an XSL transformation that will strip out development-specific attributes from deployment descriptors and other XML files. I have already successfully done so with web.xml but...
2
by: Christoph Niemann | last post by:
Hello, I want to output an element with an attribute. The attribute's value shall contain a entity reference. Is that possible at all? I use this source-XML and xsl-stylesheet: <?xml...
4
by: Figo 775 | last post by:
Hi, I have an xml document which is as below: <?xml version="1.0" encoding="UTF-8"?> <fragment name="htmlPart"> <value>&lt;table&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;Feature&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b &gt;Benefit&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;...
4
by: Tjerk Wolterink | last post by:
I've xml code like this: roles.xml: <?xml version="1.0" encoding="ISO-8859-1"?> <roles xmlns="http://www.wolterinkwebdesign.com/xml/roles"> <!-- ! The admin role. ! And admin should have...
4
by: Dwayne Epps | last post by:
I've created a function that checks form fields that only will have letters. This is the script: <script type="text/javascript" language="javascript"> function validateString(field, msg, min,...
0
by: Korol | last post by:
I need to pass some value from XSL to javascript. For the reasons it is inpossible to use xsl:param and xsl:variable. There is some ‘if’ conditions in XSL that would modify that value. I create id...
4
by: Doug | last post by:
I'm learning how to use the XSL transform functionality and can't get it to work. In a book I'm reading on it, it says that I can do like I did below and just add a value like <root_node/> in...
2
by: Beniamin Tecar | last post by:
Hi, I have an xml : <DataRecords> <Point Alias='A' Value='1' Status='0' /> <Point Alias='B' Value='2' Status='0' /> </DataRecords> I have needed by an XSL to insert a node between...
6
by: Kourosh | last post by:
I can't figure out how to do this because the tags have to be properly nested... and I dont have much XSL experience. Say I'm generating an HTML tag in my XSL file, and for one of it's attributes,...
1
by: manojtjain | last post by:
I have a report which has 3 subreports included within it, each separated by a page break. So totally 4 pages are generated for the report. The second page shows an unwanted value in Left Hand Top...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.