473,491 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pre-format text in an XML file

I have text in an xml file which I wish to pre-format before it is read into
an xsl document and displayed in an xml control. In the xml file I have
something like this:

<section><![CDATA[<h1> first message</h1> second message <b> third
message</b>]]>

However, when it is rendered on the page it appears like this:

<h1> first message</h1> second message <b> third message</b>

I need it to be rendered as html when the page is displayed. Any ideas?
Jun 11 '06 #1
2 1692


cashdeskmac wrote:
I have text in an xml file which I wish to pre-format before it is read into
an xsl document and displayed in an xml control. In the xml file I have
something like this:

<section><![CDATA[<h1> first message</h1> second message <b> third
message</b>]]>

However, when it is rendered on the page it appears like this:

<h1> first message</h1> second message <b> third message</b>

I need it to be rendered as html when the page is displayed. Any ideas?


If you are using XSLT then you would need e.g.
<xsl:template match="section">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:template>
to make sure the tags in the CDATA section are not escaped.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jun 11 '06 #2
Many thanks, Martin, that is perfect.

"Martin Honnen" wrote:


cashdeskmac wrote:
I have text in an xml file which I wish to pre-format before it is read into
an xsl document and displayed in an xml control. In the xml file I have
something like this:

<section><![CDATA[<h1> first message</h1> second message <b> third
message</b>]]>

However, when it is rendered on the page it appears like this:

<h1> first message</h1> second message <b> third message</b>

I need it to be rendered as html when the page is displayed. Any ideas?


If you are using XSLT then you would need e.g.
<xsl:template match="section">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:template>
to make sure the tags in the CDATA section are not escaped.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Jun 11 '06 #3

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

Similar topics

2
3687
by: Porthos | last post by:
Hi All, I'm building an XSL document that puts two types of information in a table dimension: preformatted data and data extracted from my XML document (see below) <table> <tr>
21
10175
by: Headless | last post by:
I've marked up song lyrics with the <pre> tag because it seems the most appropriate type of markup for the type of data. This results in inefficient use of horizontal space due to UA's default...
7
18509
by: Alan Illeman | last post by:
How do I set several different properties for PRE in a CSS stylesheet, rather than resorting to this: <BODY> <PRE STYLE="font-family:monospace; font-size:0.95em; width:40%; border:red 2px...
1
4716
by: R0bert Nev1lle | last post by:
Here's my next IE challenge (or frustration). It deals with the overflow attribute. Overflow property was a challenge on my page since the page emulates position fixed for IE. The present...
8
3765
by: Jarno Suni not | last post by:
It seems to be invalid in HTML 4.01, but valid in XHTML 1.0. Why is there the difference? Can that pose a problem when such a XHTML document is served as text/html?
9
5525
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
23
3583
by: Xah Lee | last post by:
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a...
7
4839
by: Paul Connolly | last post by:
char *s = "Hello"; s = 'J'; puts(s); might print "Jello" in a pre-ANSI compiler - is the behaviour of this program undefined in any pre-ANSI compiler - or would it always have printed "Jello"...
12
5547
by: Vadim Guchenko | last post by:
Hello. I'm using the following code: <html> <head> <style type="text/css"> pre {display: inline;} </style> </head>
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7360
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...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.