XSLを使用してChromeでリンクを表示すると面倒な問題が発生します:すべてのリンクが16進数記号「%0A」で連結されています。
リンクが「www.google.com」の場合、「www.google.com%0A」と表示されます。
この問題は、Google Chromeでのみ発生します。Internet ExplorerとFireFoxは正しくリンクしています。
私の質問は:どうすればGoogle Chromeがリンクを邪魔するのを防ぐのですか? ここではXMLファイルのサンプルです:リンク、xsl、なぜ改行を改行するか(別名%0A HEXシンボル)
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="builtMathCSStatisticsXML.xsl"?>
<channel>
<item>
<title>algrbra
</title>
<type>class notes
</type>
<staff>Noga Alon
</staff>
<semester>
</semester>
<year>2011
</year>
<donor>anonymous
</donor>
<link>https://skydrive.live.com/self.aspx?path=%2f%d7%9e%d7%aa%d7%9e%d7%98%d7%99%d7%a7%d7%94%2f%d7%90%d7%9c%d7%92%d7%91%d7%a8%d7%94%20%d7%911.%d7%a9%d7%99%d7%a2%d7%95%d7%a8%d7%99%d7%9d%20%d7%95%d7%aa%d7%a8%d7%92%d7%99%d7%9c%d7%99%d7%9d.%d7%a0%d7%95%d7%92%d7%94%20%d7%90%d7%9c%d7%95%d7%9f%5e.%d7%aa%d7%a9%d7%a1%5e4%5e4%d7%96%20-%20%d7%a8%d7%95%d7%a2%d7%99%20%d7%a7%d7%9c%d7%99%d7%99%d7%9f.pdf&cid=1f8a5680599afff9
</link>
</item>
...
</channel>
は、ここでXSLファイルです:
<?xml version="1.0"?
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<script src="sorttable.js"></script>
</head>
<body dir="rtl">
<h2>Math CS and Statistics</h2>
<table class="sortable">
<thead>
<tr bgcolor="#9acd32">
<th>course</th>
<th>type</th>
<th>proffesor</th>
<th>semster</th>
<th>year</th>
<th>donors</th>
<th>links</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="channel/item">
<xsl:sort select="title" />
<tr onMouseOver="this.bgColor='yellow';" onMouseOut="this.bgColor='white';">
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="type"/></td>
<td><xsl:value-of select="staff"/></td>
<td><xsl:value-of select="semester"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="donor"/></td>
<td>
<a target="_blank"><xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>link</a>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
感謝!
ありがとう!あなたの答えはとても役に立ちました –
@hershalle:あなたは大歓迎です。 –