Subject: [xsl] how-to change &#*****; to &#****; From: "Christoph Klocker" <klocker@xxxxxxxxxxxxx> Date: Tue, 9 Nov 2004 12:23:30 +0100 |
Hi, I hope you can help me once again. I have an ESQL query to our MSSQL database via the JDBC driver, where I query chinese Unicode characters. Unfortunately I didn't find an solution to get the unicode characters out of the database, so I try a different solution in applying an xsl-transformation and replace the & with &. However it doesn't work. my xml <categories xmlns:xsp="http://apache.org/xsp" xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1" xmlns:esql="http://apache.org/cocoon/SQL/v2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <category> <FaaLocTextCH>&#32173;&#20063;&#32013;</FaaLocTextCH> </category> <category> <FaaLocTextCH>&#27861;&#34349;&#20811;&</FaaLocTextCH> </category> <category> <FaaLocTextCH>&#32016;&#32004; </FaaLocTextCH> </category> <category> <FaaLocTextCH>&#39321;&#28207;</FaaLocTextCH> </category> <category> <FaaLocTextCH>&#38463;&#22982;&#26031;&</FaaLocTextCH> </category> </categories> and my stylesheet I try to apply <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="/categories/category"> <xsl:call-template name="escape-apos"> <xsl:with-param name="text" select="." /> </xsl:call-template> </xsl:template> <xsl:template name="escape-apos"> <xsl:param name="text" /> <xsl:variable name="apos">&</xsl:variable> <xsl:choose> <xsl:when test="contains($text, $apos)"> <xsl:value-of select="substring-before($text, $apos)" /> <xsl:text disable-output-escaping="yes">&</xsl:text> <xsl:call-template name="escape-apos"> <xsl:with-param name="text" select="substring-after($text, $apos)" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$text" /> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> thanks for any suggestion Christoph
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] acccessing and changing r, Jarno.Elovirta | Thread | [xsl] Variables and command line pa, Kevin Bird |
Re: [xsl] Conditional extraction of, Geert Josten | Date | [xsl] Variables and command line pa, Kevin Bird |
Month |