xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Dubien <xa...@dubien.org>
Subject Xalan-Java extension with special chars
Date Fri, 28 Jun 2013 11:23:43 GMT
Hi,

I would like to know how I can use Xalan-Java extensions to compute data
and return special chars like <, >.. without being escaped.

Actually, I'm using the following xsl instruction in my xsl file:
<xsl:value-of select="xalanexample:addcolor(@first)"/>

I would like a return like:
<fo:inline color="red">David</fo:inline>
But instead of that, the return is:
&lt;fo:inline color="red"&gt;David&lt;/fo:inline&gt;

My Java extension is:
public String addcolor(String name) {
        String result = ((name.compareTo("David") == 0) ? "<fo:inline
color=\"red\">" : "<fo:inline color=\"blue\">") + name + "</fo:inline>";
        return result;
}

How could I do?

I am looking forward to hearing from you,
Nicolas DUBIEN

Mime
View raw message