T
toyz
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>
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>