I am trying to retrieve parameter values from the URL using XML but I can't seem to retrieve the data. Kindly check the photo I posted below to get a clearer view:
From what I understand, the < xsl:param name="page" > will automatically retrieve the value from the URL. I decided to put a default value of 666, however I tried testing it through my WAMP server and added the parameter page=1. I was expecting that my XSL would display the value rather than the 666. Am I missing something here?
I've been following a XSLT pagination tutorials and most I found does it this way (to keep track the current page) and I'm no sure why it isn't working for me. Any help would be greatly appreciated. Thanks.
Here is how my XSL code looks like (removed all my code and placed only the part I'm concerned with):
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<xsl:template match="/">
The value of current page is:
<xsl:value-of select="$currentPage" />
</xsl:template>
</xsl:stylesheet>
Here's how my XML looks like, nothing special but just links to the XSL:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="laptops.xsl"?>
<laptops>
</laptop>
So I was expecting that when I call my XML file through the browser with with a URL parameter of "?page=1", it gets rendered with XSL, I should be able to retrieve the value '1' and the XSL will display it. However I'm not able to retrieve any value from the URL.