Hello,
I'm attempting to construct a URL composed of a set of xsl variables
in an xsl stylesheet, but am not receiving the expected results.
Below is an example of what I am attempting to do.
*** XML Doc test.xml
<?xml version="1.0"?>
<?xml-stylesheet href="test.xsl"
type="text/xsl"
title=""
alternate="no"
media="screen"?>
<page>
<title>This is the page Title</title>
<entries>
<entry name="First Entry">
<id>1</id>
<data>D1</data>
</entry>
<entry name="Second Entry">
<id>2</id>
<data>D2</data>
</entry>
</entries>
</page>
*** Transformed with test.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/page">
<html>
<head>
<title><xsl:value-of select="title"/></title>
</head>
<h1><xsl:value-of select="time"/></h1>
<body>
<xsl:apply-templates select="entries"/>
</body>
</html>
</xsl:template>
<xsl:template match="entries">
<table border="1">
<tr>
<td>ID</td>
<td>Data</td>
<td>Name</td>
<td>URL</td>
</tr>
<xsl:apply-templates select="entry"/>
</table>
</xsl:template>
<xsl:template match="entry">
<xsl:variable name="id" select="id"/>
<xsl:variable name="data" select="data"/>
<tr>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="data"/></td>
<td><xsl:value-of select="@name"/></td>
<td>
<a href="/BLAH?id={$id}&data={$data}">URL</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
*** The result:
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>This is the page Title</title>
</head>
<h1></h1>
<body><table border="1">
<tr>
<td>ID</td>
<td>Data</td>
<td>Name</td>
<td>URL</td>
</tr>
<tr>
<td>1</td>
<td>D1</td>
<td>First Entry</td>
<td><a href="/BLAH?id=1%26amp;data=D1">URL</a></td>
</tr>
<tr>
<td>2</td>
<td>D2</td>
<td>Second Entry</td>
<td><a href="/BLAH?id=2%26amp;data=D2">URL</a></td>
</tr>
</table></body>
</html>
The expected result would include the & character within the href
attribute of the anchors, like this:
<td><a href="/BLAH?id=2&data=D2">URL</a></td>
Is there a flag or setting that must be configured to allow this,
or is there another way to accomplish this goal. I have used this
same technique in Cocoon without any trouble, and am just wondering
if AxKit expects one to do this in some other manner.
Any tips will be much appreciated.
Thanks,
~brian skrab
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]