Connecting Tech Pros Worldwide Forums | Help | Site Map

XSL - Dynamically enter blank lines in XHTML

Newbie
 
Join Date: Apr 2009
Posts: 12
#1: Apr 20 '09
I am creating a 5 page document HTML document with variable table sizes. I am hard coding page breaks after the <DIV> for each page. To assure that all of my page numbers at the bottom of each page is in approximately the same location, I have created a recursive template to enter a certain number of <BR/> elements before the page # footer. However, the <BR/> isn't doing the trick. I've searched high and low for the right character to enter and nothing has worked:

Expand|Select|Wrap|Line Numbers
  1.     <xsl:variable name="newline">
  2.         <!-- 
  3.         <xsl:text>
  4. </xsl:text>        
  5.         <p>&nbsp;</p>
  6.         http://www.danrigsby.com/blog/index.php/category/xslt/
  7.         *&nbsp;<br/>
  8.         <xsl:value-of select="'&#xA;'"/>
  9.         <xsl:text>&#xA;</xsl:text>
  10.         -->
  11.         <br/>*&nbsp;<br/>
  12.     </xsl:variable>    
Also, should I use line position to determine the number of blank lines I need instead of the number of rows in my variable tables?

Thanks for any and all help !!!!

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,648
#2: Apr 20 '09

re: XSL - Dynamically enter blank lines in XHTML


is it for print or browser display?
Newbie
 
Join Date: Apr 2009
Posts: 12
#3: Apr 20 '09

re: XSL - Dynamically enter blank lines in XHTML


Mainly print, though we will also be viewing inside a browser control in a .NET application. Eventually, we want to convert XHTML to PDF, but no time now to create an XSL-FO. Thanks!
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,648
#4: Apr 20 '09

re: XSL - Dynamically enter blank lines in XHTML


although XSL-FO would probably be the best for print… maybe you can experiment a bit with the print-formatting options in CSS.

other than that I could only imagine to giving divs the height you want for a quick trial.
Newbie
 
Join Date: Apr 2009
Posts: 12
#5: Apr 20 '09

re: XSL - Dynamically enter blank lines in XHTML


Any ideas on how to get a blank line into the HTML so that my page # footer can be moved further down the page?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,648
#6: Apr 20 '09

re: XSL - Dynamically enter blank lines in XHTML


usually inserting breaks, though consider a div with a set height.
Newbie
 
Join Date: Apr 2009
Posts: 12
#7: Apr 20 '09

re: XSL - Dynamically enter blank lines in XHTML


Thanks. I'll look into giving a DIV a set height. Does anyone know how I can programmatically insert blank lines in a recursively called template? If I manually place the <BR/> into the XSL, they work in the resulting HTML file, but not in the xsl:template I have.
Reply

Tags
<br/>, break, html, line, xml