Re: [xsl] encoding problem

Subject: Re: [xsl] encoding problem
From: Daniel Purucker <dpu@xxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2004 15:03:57 +0200
Hi, sorry for the late response....and thank you very much for your answer.
As Michael said "it's unsafe to use non ASCII characters in the names of HTML-Anchors" i'd now like to replace all '_' in my file with '&#224' also also all d.v, and so on... (as Pieter proposed)


I'd also like to use another xslt-stylesheet for this task. Now my questions:
a) is it possible?
b) am not allowed to change the original xml-file, but don't want to implement all the stuff inside of the xslt doing it 'on the fly'.
--> Is there a way to include an xslt-stylsheet inside my actual styleshett, which:
- replaces the characters
- creates some sort of temporary-xml-file without all these umlaute?


Is this a possible solution, is there a better way to do it?

Second question: How do i do that? translate() just replaces one character with another. i now just tried the following, which doesn't seems to be a 'nice' solution:
<xsl:value-of selected="substring-before($combomodell, '_')"/>
<xsl:text>&#224</xsl:text>
<xsl:value-of select="substring-after($combomodell, '_')"/>


Help is very much appreciated.

Thanx in advance,
daniel


Am 12.04.2004 um 23:36 schrieb Pieter Reint Siegers Kort:


Hi Daniel,

If you define your output to be HTML, like this:

<xsl:output method="html" indent="yes"/>

the processor should know to process html, and might well be able to let the
'_' through, as is.


If you already have the output defined as html, then you could simply check
if the node text contains the '_' and replace this by '&#224;'; this will
output '&szlig;' which will show up as a '_' in the browser.


Let me know if any of this helps you in the right direction.

Cheers, Pieter

<prs/>
http://www.pietsieg.com
http://www.pietsieg.com/dotnetnuke
Contributor on www.ASPToday.com
Co-author on "Professional ASP.NET XML with C#", July 2002 by Wrox Press

Current Thread