Michael, Thank you very much for your reply. I really appreciate it.
Can you please look at my code and tell me where i am doing wrong. Its been 2 weeks and still i am not able to proceed.
Here is my xml file.
- <Root>
- <Forms>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
</Forms>
- <Buttons>
<Previous>10</Previous>
<Next>30</Next>
<CurrentPage>3</CurrentPage>
</Buttons>
<Records>88</Records>
<CurrentPage>3</CurrentPage>
<NoOfPages>9</NoOfPages>
- <Pages>
<Page>1</Page>
<Page>2</Page>
<Page>3</Page>
<Page>4</Page>
<Page>5</Page>
<Page>6</Page>
<Page>7</Page>
<Page>8</Page>
<Page>9</Page>
</Pages>
<BeginRecord>21</BeginRecord>
<EndRecord>30</EndRecord>
<catg>5</catg>
</Root>
Here is the code from my xslt file. The code that i am trying to use to print page numbers is between xsl:foreach select="Pages" and then using xsl:value-of select="page". All i am trying to do is print the value of all the page nodes. Hope i am explaining it right. If i am doing it wrong, please tell me how to do it right. I need to get this right immediately. Thank you once agian for your help.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="Root">
<xsl:param name="page-num" select="1"/>
<xsl:variable name="page-size" select="20" />
<xsl:for-each select="Pages">
<xsl:value-of select="Page" />
</xsl:for-each>
<SCRIPT LANGUAGE="JavaScript">
function DownLoad() {
var url;
url = location.href;
window.open(url, '640x480', '_popup', 'height=640, width=480, scrollbars, left=10, top=10, screenX=10, screenY=10');
}
</SCRIPT>
<table border="0" cellpadding="3" cellspacing="0" width="600">
<tr>
<td colspan="3">
<span class="bc2">
<xsl:value-of select="Records"/> Forms</span>
</td>
<td colspan="2" align="right">
<span class="bc2">
<xsl:value-of select="BeginRecord"/> of
<xsl:value-of select="EndRecord"/></span>
</td>
</tr>
<tr>
<td colspan="2">
<span class="bc3"><br/>
</span>
</td>
</tr>
<xsl:for-each select="Root">
<xsl:apply-templates select="CurrentPage"/>
<xsl:apply-templates select="NoOfPages"/>
</xsl:for-each>
<tr>
<td colspan="2">
<span class="bc3">
<xsl:value-of select="NoOfPages"/>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<span class="bc3"><br/>
</span>
</td>
</tr>
</table>
<table border="0" cellpadding="3" cellspacing="1" width="600" bgcolor="white">
<tr bgcolor="#7f0000">
<td colspan="6"><span class="bh3">Forms</span></td>
</tr>
<tr bgcolor="#cccccc">
<td width="28"></td>
<td width="200">
<span class="bc2">Name </span>
</td>
<td width="267">
<span class="bc2">Version</span>
</td>
<td align="right" width="10">
<a href="#" onclick="window.open('help/help_forms.html', '_popup', 'height=315, width=315, scrollbars, left=10, top=10, screenX=10, screenY=10');return false">
<img src="../images/icons_help.gif" width="12" height="12" hspace="1" border="0"/>
</a>
</td>
<td align="right" width="75">
<span class="bc2">Options</span>
</td>
</tr>
<xsl:for-each select="Forms">
<xsl:apply-templates select="Form"/>
</xsl:for-each>
<tr align="center">
<td colspan="5">
<form name="Next" method="Get" action="catlist.asp?paging=next?page=CurrentPage">
<input type="hidden" name="catg">
<xsl:attribute name="value">
<xsl:value-of select="catg"/>
</xsl:attribute>
</input>
<input type="hidden" name="CurrentPage">
<xsl:attribute name="value">
<xsl:value-of select="CurrentPage"/>
</xsl:attribute>
</input>
<xsl:if test="Buttons/Previous">
<input type="submit" value="Previous" name="Next" class="bc2" />
<input type="hidden" name="PreviousRS">
<xsl:attribute name="value">
<xsl:value-of select="Buttons/Previous"/>
</xsl:attribute>
</input>
</xsl:if>
<xsl:if test="Buttons/Next">
<input type="submit" value=" Next " name="Next" class="bc2"/>
<input type="hidden" name="NextRS">
<xsl:attribute name="value">
<xsl:value-of select="Buttons/Next"/>
</xsl:attribute>
</input>
</xsl:if>
</form>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="Form">
<tr>
<xsl:attribute name="bgcolor">
<xsl:value-of select="Color"/>
</xsl:attribute>
<td width="28">
<img>
<xsl:attribute name="src">
<xsl:value-of select="Img"/>
</xsl:attribute>
</img>
</td>
<td width="200">
<span class="bc3">
<xsl:value-of select="Name"/>
</span>
</td>
<td colspan="2">
<span class="bc3">
<xsl:value-of select="Desc"/>
</span>
</td>
<td align="right" width="85">
<xsl:if test="Preview">
<a>
<xsl:attribute name="href">
<xsl:value-of select="Preview"/>
</xsl:attribute>
<xsl:attribute name="Target">
New
</xsl:attribute>
<img src="../images/preview.gif" border="0"/>
</a>
</xsl:if>
<xsl:if test="Download">
<a>
<xsl:attribute name="href">
<xsl:value-of select="Down"/>
</xsl:attribute>
<img src="../images/down.gif" border="0"/>
</a>
</xsl:if>
<xsl:if test="Modify">
<a>
<xsl:attribute name="href">
<xsl:value-of select="Modify"/>
</xsl:attribute>
<img src="../images/modify.gif" border="0"/>
</a>
</xsl:if>
<xsl:if test="OrderFax">
<a target="new">
<xsl:attribute name="href">
<xsl:value-of select="OM"/>
</xsl:attribute>
<img align="center" src="../images/rx.gif" border="0"/>
</a>
</xsl:if>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
|