[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] how-to change &#*****; to &#****;
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|