£ sign with xsl

T

thomas

Anyone know how can I get a £ sign in the cell of a table that has been
output by an xsl page

I've tried

<td>£<xsl:apply-templates select="./price" /></td>
<td>£<xsl:apply-templates select="./price" /></td>

both of these give a ? sign instead of a £ sign and the following gives an
error

<td>&pound;<xsl:apply-templates select="./price" /></td>

This is driving me mad?
 
R

Richard Tobin

thomas said:
<td>£<xsl:apply-templates select="./price" /></td>
<td>£<xsl:apply-templates select="./price" /></td>

Both of these are correct.
both of these give a ? sign instead of a £ sign

That sentence appears on my screen with two question marks in it,
which is a clue to the cause of your problem.

Most likely, your XSLT processor is outputting the document in one
encoding, but your HTML viewer is interpreting it in some other
encoding. If you're looking at it in a browser, try telling it to
assume a different encoding (UTF-8 for example). Or try telling XSLT
to output it in Latin-1 by using <xsl:eek:utput encoding="iso-8859-1"/>.

-- Richard
 
T

thomas

If you go to http://www.guitarmidi.co.uk/gui/browse.asp?id=h and view
source, the following line is in the <head> <META http-equiv="Content-Type"
content="text/html; charset=UTF-16">. Is this why i'm having problems? I
take data from the field on index.html and pass them to search.asp, this
page opens search.xsl

******************************************************************
index.html
========

<html>
<head>
<title>GuitarMidi</title>
<link href="mystyle.css" rel="stylesheet" type="text/css">
</head>
<body>

<table class="one">
<tr>
<td>
<p class = "one">search for artist or song</p>
<form method="post" action="search.asp">
<table class="two">
<tr>
<td><input type="text" name="textQuery" size="50"></td>
</tr>
</table>
<p><input type="submit" value="Search"/></p>
</form>

<p><a href="view.asp">view all</a></p>

</td>
</tr>
</table>

<p><a
href="javascript:window.external.AddFavorite('http://www.guitarmidi.co.uk','GuitarMidi')">Add
to favourites</a>
| <a href="http://www.vanbasco.com/karaokeplayer/"
target="_blank">vanBasco's Karaoke Player</a></p>

<p>
<a href="http://validator.w3.org/check/referer" target="_blank">
<img src="images/valid_xhtml.png"
alt="Valid XHTML 1.0!" width="80" height="15"/></a>

<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">
<img src="images/valid_css.png"
alt="Valid CSS!" width="80" height="15"/></a>
</p>

</body>

</html>


***************************************************************
search.asp
========

<%@ Language="VBScript" %>

<%

dim objDom, fileExists, objFieldValue, objPI

st1 = Request.Form("textQuery")
st2 = Request.QueryString("startPos")

a=Split(lcase(st1))

set xmlDocument = CreateObject("MSXML2.FreeThreadedDOMDocument")
xmlDocument.async="false"
xmlDocument.load(Server.MapPath("db/data.xml"))

set xslDocument = CreateObject("MSXML2.FreeThreadedDOMDocument")
xslDocument.async="false"
xslDocument.load(Server.MapPath("search.xsl"))

Set XSLTemplate = Server.CreateObject("MSXML2.XSLTemplate")
Set XSLTemplate.stylesheet = xslDocument
Set proc = XSLTemplate.createProcessor()

proc.input = xmlDocument

for n = 0 to ubound(a)
proc.addParameter "text" & n, a(n)
next

proc.addParameter "full", st1

proc.Transform
Response.Write proc.output

%>

*************************************************************************
search.xsl
=======

<?xml version="1.0"?>

<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:eek:utput method="html"/>

<xsl:param name="text0" />
<xsl:param name="text1" />
<xsl:param name="text2" />
<xsl:param name="text3" />
<xsl:param name="text4" />

<xsl:template match="/">

<html>

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
<title>Results</title>
</head>

<body>

<table class="three" align="center">

<col width="40%"/>
<col width="40%"/>
<col width="10%"/>
<col width="10%"/>

<tr>
<th class="head1">Artist</th>
<th class="head1">Song</th>
<th class="head">Chord</th>
<th class="head">Midi</th>
</tr>

<xsl:for-each select="(cat/links[(contains(artist, $text0) or contains(song,
$text0)) and
(contains(artist, $text1) or contains(song, $text1)) and
(contains(artist, $text2) or contains(song, $text2)) and
(contains(artist, $text3) or contains(song, $text3)) and
(contains(artist, $text4) or contains(song, $text4))])[position() &lt;=
20]">

<xsl:sort select="artist"/>
<xsl:sort select="song"/>

<tr>
<td class="one"><xsl:apply-templates select="./artist"/></td>
<td class="one"><xsl:apply-templates select="./song"/></td>
<xsl:variable name="path1"><xsl:apply-templates
select="./path"/></xsl:variable>
<td><a href="media/{$path1}.txt" target="_blank">view</a></td>
<td><a href="media/{$path1}.mid">play</a></td>
</tr>

</xsl:for-each>

</table>

<a href="index.html">Click here to return to search page</a>

</body>

</html>

</xsl:template>

</xsl:stylesheet>
 
P

Peter Flynn

Richard said:
Both of these are correct.


That sentence appears on my screen with two question marks in it,
which is a clue to the cause of your problem.

And it appears on my screen as two spaces, which should be more of
a clue.

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,850
Latest member
VMRKlaus8

Latest Threads

Top