XML text to HTML

S

Son KwonNam

When I have XML text data like the following..
------ XML Snippet -----
<TEXT>
Hello,
XML &amp; Java Newsgroup!
</TEXT>
------------------------

I hope to get the following html
------- HTML Sinppet -----
Hello,<BR/>
XML&nbsp;&amp;&nbsp;Java&nbsp;Newsgroup!<BR/>
--------------------------

I tried a java extension, which just replaces &,whitespace and new
line(\n) to their corresponding html elements
then, get the text from the method with

<xsl:value-of select="tth:textToHtml(.)"/>

But failed, because Xalan prints html like
-------------------------
Hello,&lt;BR/&gt;
XML&amp;nbsp;&amp;amp;&amp;nbsp;Java&amp;nbsp;Newsgroup!&lt;BR/&gt;
--------------------------

I use Xalan for transforming.
How can I get the correct html from xml text?

Regards,
KwonNam.
 
S

Son KwonNam

The answer is

<xsl:value-of select="tth:textToHtml(.)" disable-output-escaping="yes"/>

:)

Son KwonNam ¾´ ±Û:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top