Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > sign with xsl

Reply
Thread Tools

sign with xsl

 
 
thomas
Guest
Posts: n/a
 
      10-29-2005
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>&#x00A3;<xsl:apply-templates select="./price" /></td>
<td>&#163;<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?


 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      10-29-2005
In article <MfA8f.36219$(E-Mail Removed)>,
thomas <(E-Mail Removed)> wrote:

><td>&#x00A3;<xsl:apply-templates select="./price" /></td>
><td>&#163;<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 <xslutput encoding="iso-8859-1"/>.

-- Richard

 
Reply With Quote
 
 
 
 
thomas
Guest
Posts: n/a
 
      10-29-2005
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"
xmlnssl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html"/>

<xslaram name="text0" />
<xslaram name="text1" />
<xslaram name="text2" />
<xslaram name="text3" />
<xslaram 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>


"Richard Tobin" <(E-Mail Removed)> wrote in message
news:djuk13$ema$(E-Mail Removed)...
> In article <MfA8f.36219$(E-Mail Removed)>,
> thomas <(E-Mail Removed)> wrote:
>
>><td>&#x00A3;<xsl:apply-templates select="./price" /></td>
>><td>&#163;<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 <xslutput encoding="iso-8859-1"/>.
>
> -- Richard
>



 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      10-29-2005
Richard Tobin wrote:

> In article <MfA8f.36219$(E-Mail Removed)>,
> thomas <(E-Mail Removed)> wrote:
>
>><td>&#x00A3;<xsl:apply-templates select="./price" /></td>
>><td>&#163;<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.


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

///Peter
--
XML FAQ: http://xml.silmaril.ie/


 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      10-29-2005
thomas wrote:

> 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?


Yes. If your work is all in English, why use twice as many bytes
as you need to?

///Peter
--
XML FAQ: http://xml.silmaril.ie/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
$ sign to gb pound sign PWB Computer Support 6 02-19-2007 03:06 AM
Automatic sign-up and sign-in across different domains without cookies? Jimmy ASP .Net 1 11-21-2006 04:41 PM
Automatic sign-up and sign-in between different domains without cookies? Jimmy Javascript 3 11-20-2006 01:28 PM
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
J sign instead of ? sign Harold Potter esq. Computer Support 5 04-16-2005 02:19 PM



Advertisments