The Datapagesize doesnot work on the Datafld in the code below. Can I use/combine xsl:apply-templates instead of a SPAN ?
- Newbie
Sample XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Reports</TITLE>
</HEAD>
<BODY VLINK="#808080" ALINK="#800080" LINK="#008000">
<XML ID="dsoReports" SRC="Reports.xml"></XML>
<DIV ALIGN="CENTER">
<TABLE DATASRC="#dsoReports" BORDER="1">
<TR><TD>
<xsl:apply-templates
select="Reports/Title">
</xsl:apply-templates>
</TD></TR>
<TR><TD>
<TABLE ID="ReportInfoTable" DATAFLD="ReportInfo" DATAPAGESIZE="2" BORDER="1" CELLPADDING="5" WIDTH="100%">
<TR><TD>
<xsl:apply-templates select="Reports/ReportInfo">
</xsl:apply-templates>
</TD></TR>
</TABLE>
<HR></HR>
<BUTTON ONCLICK="ReportInfoTable.firstPage()">|<First Page</BUTTON>
<BUTTON ONCLICK="ReportInfoTable.previousPage()"><Previous Page</BUTTON>
<BUTTON ONCLICK="ReportInfoTable.nextPage()">Next Page ></BUTTON>
<BUTTON ONCLICK="ReportInfoTable.lastPage()">Last Page ></BUTTON>
</TD></TR>
</TABLE>
</DIV>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="Reports/Title">
<TR><TD bgcolor="fuschia" ALIGN="CENTER">
<SPAN STYLE="FONT-WEIGHT:BOLD;"><xsl:value-of select="." /></SPAN>
</TD></TR>
</xsl:template>
<xsl:template match="Reports/ReportInfo[Period='Weekly']">
<TR><TD ALIGN="CENTER">
<SPAN STYLE="FONT-STYLE:ITALIC">Week Ending:
<A>
<xsl:attribute name="href">
<xsl:value-of select="DocName" />
</xsl:attribute>
<xsl:value-of select="ReportName" />
</A></SPAN></TD></TR>
</xsl:template>
<xsl:template match="Reports/ReportInfo[Period='Monthly']">
<TR><TD BGCOLOR="#COCOFF" ALIGN="CENTER">
<SPAN STYLE="FONT-STYLE:ITALIC; FONT-WEIGHT:BOLD">Month Ending:
<A>
<xsl:attribute name="href">
<xsl:value-of select="DocName" />
</xsl:attribute>
<xsl:value-of select="ReportName" />
</A></SPAN></TD></TR>
</xsl:template>
</xsl:stylesheet>
Sample XML:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Reports.xsl"?>
<Reports>
<Title>Reports Title</Title>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>December 2003</ReportName>
<Period>Monthly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>26 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>19 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>12 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>05 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
</Reports>
- Newbie
Sample XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Reports</TITLE>
</HEAD>
<BODY VLINK="#808080" ALINK="#800080" LINK="#008000">
<XML ID="dsoReports" SRC="Reports.xml"></XML>
<DIV ALIGN="CENTER">
<TABLE DATASRC="#dsoReports" BORDER="1">
<TR><TD>
<xsl:apply-templates
select="Reports/Title">
</xsl:apply-templates>
</TD></TR>
<TR><TD>
<TABLE ID="ReportInfoTable" DATAFLD="ReportInfo" DATAPAGESIZE="2" BORDER="1" CELLPADDING="5" WIDTH="100%">
<TR><TD>
<xsl:apply-templates select="Reports/ReportInfo">
</xsl:apply-templates>
</TD></TR>
</TABLE>
<HR></HR>
<BUTTON ONCLICK="ReportInfoTable.firstPage()">|<First Page</BUTTON>
<BUTTON ONCLICK="ReportInfoTable.previousPage()"><Previous Page</BUTTON>
<BUTTON ONCLICK="ReportInfoTable.nextPage()">Next Page ></BUTTON>
<BUTTON ONCLICK="ReportInfoTable.lastPage()">Last Page ></BUTTON>
</TD></TR>
</TABLE>
</DIV>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="Reports/Title">
<TR><TD bgcolor="fuschia" ALIGN="CENTER">
<SPAN STYLE="FONT-WEIGHT:BOLD;"><xsl:value-of select="." /></SPAN>
</TD></TR>
</xsl:template>
<xsl:template match="Reports/ReportInfo[Period='Weekly']">
<TR><TD ALIGN="CENTER">
<SPAN STYLE="FONT-STYLE:ITALIC">Week Ending:
<A>
<xsl:attribute name="href">
<xsl:value-of select="DocName" />
</xsl:attribute>
<xsl:value-of select="ReportName" />
</A></SPAN></TD></TR>
</xsl:template>
<xsl:template match="Reports/ReportInfo[Period='Monthly']">
<TR><TD BGCOLOR="#COCOFF" ALIGN="CENTER">
<SPAN STYLE="FONT-STYLE:ITALIC; FONT-WEIGHT:BOLD">Month Ending:
<A>
<xsl:attribute name="href">
<xsl:value-of select="DocName" />
</xsl:attribute>
<xsl:value-of select="ReportName" />
</A></SPAN></TD></TR>
</xsl:template>
</xsl:stylesheet>
Sample XML:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Reports.xsl"?>
<Reports>
<Title>Reports Title</Title>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>December 2003</ReportName>
<Period>Monthly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>26 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>19 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>12 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
<ReportInfo>
<DocName>Dec03.doc</DocName>
<ReportName>05 December 2003</ReportName>
<Period>Weekly</Period>
</ReportInfo>
</Reports>