Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 1st, 2006, 05:35 AM
toyz
Guest
 
Posts: n/a
Default Formatting Objects in XSL

Hi all,
this look like a newbie question but I trying to find a slotion to this
for the past few days. I need to set the print format (margin, page
orientation) of a XSL in such a way that the user will be able to print
the page from the browser in a pre-defined format. I have read about
the XSL Formatting Objects and I am trying to use embedded this object
in the xsl to accomplish this. Is this possible?

Below is the sample XSL stylesheet I am trying for the past few days. I
would really appreciate if anyone can point out to me where have I gone
wrong.

<?xml version="1.0" encoding="UTF-8" ?>
<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="/">
<xmlns:fo root="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
margin-right="0cm"
margin-bottom="0cm"
margin-top="0cm"
page-width="29.7cm"
page-height="21cm"
master-name="landscape">
<fo:region-body
margin-right="0cm"
margin-bottom="0cm"
margin-top="0cm"
page-width="29.7cm"
page-height="21cm"
</fo:simple-page-master>
</fo:layout-master-set>
</xmlns:fo>

<html>
<body>
<table width="700" border="1">
<xsl:for-each select="NewDataSet/Table">
<tr height="75">
<td width="350">
<xsl:value-of select="RefNo"/>
<br/>
<xsl:value-of select="Name"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>

</xsl:template>
</xsl:stylesheet>

  #2  
Old August 13th, 2006, 10:05 PM
Peter Flynn
Guest
 
Posts: n/a
Default Re: Formatting Objects in XSL

toyz wrote:
Quote:
Hi all,
this look like a newbie question but I trying to find a slotion to this
for the past few days. I need to set the print format (margin, page
orientation) of a XSL in such a way that the user will be able to print
the page from the browser in a pre-defined format. I have read about
the XSL Formatting Objects and I am trying to use embedded this object
in the xsl to accomplish this. Is this possible?
If all you want is to display it in a browser, just use XSLT to
output it with HTML markup and use CSS to guide the formatting.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
  #3  
Old August 13th, 2006, 10:05 PM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: Formatting Objects in XSL

The classic path is to use XSLT to create XSL Formatting Object markup,
then run that through an XSL-FO processor (such as Apache's FOP) to get
the presentation-ready rendering (eg PDF). You then deliver that
rendered file to the user.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles