Hi,
I am very new to programming, and I have this problem - I want to load url from xml, and use it as a link on page created via xsl. After some not so short time spent on finding way to do it I have finally manged to, but it occurs that this little bastard adds "/" at the end of my url, making it utterly useless :/
for example: url is <link>whatever1.xml</link>, and after xsl-magic my browser really want to open "whatever1.xml/", which obviously does not make me happy :/
Sorry for exotic names, and thanks in advance for help.
Here's my xml:
Code:
?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="transformacja.xsl"?>
<katalog>
<ryba>
<nazwa>Ryba 1</nazwa>
<latin>Pisces 1</latin>
<link>ryby/ryba1.xml/</link>
</ryba>
</katalog>
And here is my xsl
Code:
<?xml version="1.0" standalone="no"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Atlas Ryb - Indeks</title>
<style type="text/css">
body
{
margin:10px 10px 10px 10px;
background-image:url('images/01.jpg');
color: #5F8700;
text-align: justify;
font-family: Georgia, "Times New Roman", Times, serif;
font-weight: normal;
letter-spacing: -1px;
font-size: 1.0em;
}
</style>
</head>
<body>
<center>
<img src="images/ObrazekIndeks.gif"/>
<h2>XXXXXXXXXXXXXXXXXXX</h2>
<p>YYYYYYYYYYYYYYYYY</p>
<table style="width:80%;" border="0">
<tr>
<td width="33,33%" align="center">dfhg</td>
<td width="33,33%" align="center">sdfg</td>
<td width="33,33%" align="left">sdfg</td>
</tr>
</table>
<xsl:apply-templates/>
</center>
</body>
</html>
</xsl:template>
<xsl:template match="katalog">
<xsl:for-each select="ryba">
<xsl:sort select="nazwa"/>
<table style="width:80%;" border="0">
<tr>
<td width="33,33%" align="center">
<xsl:value-of select="nazwa"/>
</td>
<td width="33,33%" align="center">
<xsl:value-of select="latin"/>
</td>
<td width="33,33%" align="left">
<a>
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>Zobacz
</a>
</td>
</tr>
</table>
</xsl:for-each>
<a href="niewiemco.xml">
<p>Zobacz wszystkie ryby</p>
</a>
</xsl:template>
</xsl:stylesheet>