Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML text to HTML

Reply
Thread Tools

XML text to HTML

 
 
Son KwonNam
Guest
Posts: n/a
 
      01-20-2005
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;News group!&lt;BR/&gt;
--------------------------

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

Regards,
KwonNam.
 
Reply With Quote
 
 
 
 
Son KwonNam
Guest
Posts: n/a
 
      01-20-2005
The answer is

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



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;News group!&lt;BR/&gt;
> --------------------------
>
> I use Xalan for transforming.
> How can I get the correct html from xml text?
>
> Regards,
> KwonNam.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. Jesús Bosch ASP .Net 1 07-03-2006 02:04 PM
'text/html' expected 'text/xml' WebService error Saya ASP .Net 0 08-19-2005 11:57 AM
Error: content type of 'text/html; but expected 'text/xml'. ramarnath@gmail.com ASP .Net 1 08-16-2005 09:07 AM
Re: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml' Damon Payne ASP .Net 0 03-08-2005 02:35 AM
WebService-Error: "the found request-type is 'text/html; charset=utf-8', but 'text/xml' was expected" ASP .Net 0 02-20-2004 03:37 PM



Advertisments