473,969 Members | 15,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to insert variable number of linebreaks for pdf output?

Hello,

Using docbook 4.4, docbook-xsl 1.70.1 and fop, I've successfully used
this snippet of code in a customized-layer stylesheet to insert one
linebreak:

<xsl:template match="processi ng-instruction('li nebreak')">
<fo:block> </fo:block>
</xsl:template>

and this in the xml file where I need it:

<?linebreak?>

Problem is with this, that I need to put x times <?linebreak?> in the
xml file when I need x line breaks.

I would like to have a recursive template, say linebreakn, which can
add n linebreaks, n being a variable.

I've written down the following code (which does not work):

<xsl:template name="linebreak n">
<xsl:param name="currentnu mber"/>
<xsl:param name="linenumbe r"/>
<xsl:if test="$currentn umber &lt;= $linenumber">
<fo:block>
 
</fo:block>
<xsl:call-template name="linebreak n">
<xsl:with-param name="currentnu mber" select="$curren tnumber + 1"/>
<xsl:with-param name="linenumbe r" select="$linenu mber"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

<xsl:template match="processi ng-instruction('li nebreakn')">
<xsl:param name="linenumbe r"/>
<xsl:call-template name="linebreak n">
<xsl:with-param name="linenumbe r" select="$linenu mber"/>
</xsl:call-template>
</xsl:template>

And in the xml file:

<?linebreakn 5?> for example

Could someone tell me what I'm doing wrong here as I'm a complete
newbye to templates?

Thanks in advance

Jun 14 '06 #1
0 1121

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

Similar topics

24
2491
by: CJM | last post by:
I have the following SP: CREATE PROCEDURE Orders_CreateOrder @CustomerID int, @LocationID int, @CustOrderNo varchar(20), @OrderDate smalldatetime AS Insert into Orders (CustomerID, LocationID, CustOrderNo, OrderDate)
2
2580
by: jw56578 | last post by:
Is it possible to take the result from an SP that returns 1 value and insert it into a variable?
24
22697
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double quotes? Do I need to use code to scrub each string and remove or escape the double quotes before using it in a query? The error I get is this: Error Number 3075: Syntax error (missing operator) in query expression '"credit card billed by...
36
3703
by: Wei Su | last post by:
Hi, I have a text file abc.txt and it looks like: 12 34 56 23 45 56 33 56 78 ... .. .. ... .. .. I want to get how many rows totally in the text file, how to do this? Thanks.
2
1261
by: Stefan Landgraf | last post by:
Hi there! How can i replace linebreaks with <br> in datalist output ? Is there a way i can do that in the aspx page itself without having to go through the code page? Thanks Stefan
0
1104
by: mfilpot | last post by:
I am working on a prime number generator for sschool, but I jsut can't seem to figure out how to write the contents of the variable MeSSage into a new text file, Can someone help me? the script is: '========================================================================== ' ' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0 '
2
1916
by: peter | last post by:
I have a xslt that writes a txt file from xml. Xml file is generated by a user input on a webpage and some nodes have linebreaks which corrupts my output. is there a way to generally set that xslt should ignore linebreaks or a way to use <xsl:value-of select="$VALUE"/and clear $VALUE of linebreaks or replace them with spaces?? Thanks alot! Best regards, Peter.
3
23722
by: Sirisha | last post by:
Hi, I am inserting values into databse using sqlserver stored procedures. i wrote stored preocedure,but in codebehind file(.vb file) i dont know how to pass the parameters, i got error message like this "System.Data.SqlClient.SqlException: Procedure or Function 'sp_insert' expects parameter '@TestId', which was not supplied. at System.Data.SqlClient.SqlConnection" I wrote Stored Procedure Like this:
1
3053
by: javedna | last post by:
Can PHP help with the following as I have tried in the MYSQL Forums and cant get any help Thanks Nabz ---------------------------------------- Hi I am developing a PHP MYSQL questionnaire tool. The problem I am having is that of inserting all the answers into the table. The questionnaire is Dynamic so the number of questions can vary. I have a variable that counts them so at the moment there is 75 questions.
0
10157
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
11803
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
11398
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...
1
11553
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10065
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...
0
7595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
5140
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
2
4721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.