473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

XML text to HTML

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.
Jul 20 '05 #1
1 1902
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.

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SK | last post by:
Is there a way to store HTML into a MySQL TEXT column, yet be able to search over textual content only? For example, if I store the following HTML snippet: <p>A very <em>small</em>...
2
by: Raja Kannan | last post by:
Is there a way to remove text portion from the HTML keeping the HTML Tags using the browser, say javascript RegEx or something ? I have seen lot of examples removing HTML tags to get the text...
4
by: frogman042 | last post by:
My daughter is playing around trying to learn JavaScript and she wrote a small program that prints out a message in increasing and decreasing font size and color changes. She is using document...
2
by: David Virgil Hobbs | last post by:
Loading text strings containing HTML code into an HTML parser in a Javascript/Jscript I would like to know, how one would go about loading a text string containing HTML code, so as to be able to...
3
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a...
0
by: Rey | last post by:
Howdy all. Am using visual web developer 2005 (vb), xp pro sp2. In testing of the system.net.mail to send email from an aspx page where I'm pulling the email contents from a textbox, find that...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
2
by: Slain | last post by:
I have a big list of HTML files, which need to be updated with a common text. <script language=JavaScript src="./highlight.js"></script> I need to add the above line in each of the html...
4
cassbiz
by: cassbiz | last post by:
Could use some help here. This script is carrying over an image just fine but the text isn't coming over. can you see why it is not working???? from the form I want to carry over two lines of...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.