473,770 Members | 6,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:styleshe et 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="masterset up"/>
<xsl:apply-templates/>
</fo:root>
</xsl:template>
<xsl:template name="masterset up">
<fo:layout-master-set>
<fo:simple-page-master master-name="a4"
page-height="297.00m m"
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="transpar ent"
border-style="solid"
border-width="0.00mm"
border-color="#000000"
position="absol ute"
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="Helveti ca"
color="#000000"
font-size="8pt"
font-style="normal"
font-weight="normal" >
<fo:block>
<xsl:value-of select="LastNam e"/>, <xsl:value-of
select="FirstNa me"/>
</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 2011


Brynjar Glesnes wrote:

<fo:block>
<xsl:value-of select="LastNam e"/>, <xsl:value-of
select="FirstNa me"/>


Try whether
<xsl:value-of select="LastNam e" /><xsl:text>,
</xsl:text><xsl:v alue-of select="FirstNa me" />
improves things.

--

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

<fo:block>
<xsl:value-of select="LastNam e"/>, <xsl:value-of
select="FirstNa me"/>


Try whether
<xsl:value-of select="LastNam e" /><xsl:text>,
</xsl:text><xsl:v alue-of select="FirstNa me" />
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.co m> wrote:
% Martin Honnen <ma*******@yaho o.de> wrote in message
% news:<41******* *************** @newsread4.arco r-online.net>...
% > Brynjar Glesnes wrote:
% >
% >
% > > <fo:block>
% > > <xsl:value-of select="LastNam e"/>, <xsl:value-of
% > > select="FirstNa me"/>
% >
% > Try whether
% > <xsl:value-of select="LastNam e" /><xsl:text>,
% > </xsl:text><xsl:v alue-of select="FirstNa me" />
% > 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="normali ze-space(LastName) "/>,

--

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

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

Similar topics

4
2438
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 I'm at a complete loss as to what is wrong with the one below. This is a very abbreviated server-config.wsdd: <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns="http://xml.apache.org/axis/wsdd/"...
2
1838
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 version="1.0" encoding="utf-8"?>
4
1814
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; &lt;tr&gt;&lt;td&gt;some sample text runs here&lt;/td&gt;&lt;td&gt;some sample text runs here too&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;some sample text runs here&lt;/td&gt;&lt;td&gt;some
4
1553
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 all permisions to do its task !
4
6124
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, max) { if (!min) { min = 1 } if (!max) { max = 65535} if (!field.value || field.value.length < min || field.value.max > max) { alert(msg); field.focus();
0
2475
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 in my HTML. <TABLE ALIGN ID="Table2"> <TR> <td id="hasValue"/> </TR> </TABLE>
4
1558
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 there and I should be able to transform any XML source document I have so that the results would simply contain <root_node/>. I wanted to try that, just so I could see if I understand how this is working and wrote the code and XSL file below. ...
2
4919
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 <DataRecords> and <Point> Example :
6
1977
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, I want to put the value of an XSL tag... for example: XSL file... ...... <xsl:template match="/" <div class = "{value of XSL tag 'entry' goes here}" > hello world</div>
1
1670
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 Corner. This value is present in Right Hand Top Corner, for display purpose. The Left Hand Top Corner is empty, and yet it shows this value. There is nothing beyond the margins that would spill over on the next page. Surprising part is that...
0
9591
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9869
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.