
February 5th, 2013, 10:11 AM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 1
Time spent in forums: 29 m 28 sec
Reputation Power: 0
|
|
|
Passing parameter via urlquery / pure xml/xslt
Hi experts,
I am quite new to xml/xslt programming...
I am using pure xml/xslt (no java, no php...) and want to pass a parameter value from xml to the xslt file.
I tried to do this via a urlquery in the xml file
Code:
<a>
<xsl:attribute name="href">
./myfile.xml?myparam=value </xsl:attribute>
click here
</a>
and tried to get the value within the xslt file with
Code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name=myparam/>
<xsl:template match="/">
<html>
<body>
<p>
<xsl:value-of select="$myparam" />
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
However, I could not obtain the value - myparam appears empty.
Can such an approach work at all if no "wrapping" language is used?
Cheers
Silver fern
P.S.: And sorry, if that is a very stupid question...
|