473,386 Members | 1,715 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,386 software developers and data experts.

Stupid question

I've an XML document that has HTML data inside one of the tags (with < & >
encoding as &lt; etc)
I'm Transform()ing the document using output method="html", but I get the
&lt; encoding instead of < > and friends.
How do I make this work?
If I just throw the HTML data (it's well formed) to the document and select
the containing node's contents I get the text without any HTML Formatting.
If I encode it using &lt; I get the same &lt; as I put in, instead of
reversing it to <
If I put it in a CData (using < & > OR &lt;) I get &lt; !
I'm sure it's a simple question, but I've been googling for the past hour
without success.
Nov 12 '05 #1
3 1705
Ayende Rahien wrote:
I've an XML document that has HTML data inside one of the tags (with < & >
encoding as &lt; etc)
I'm Transform()ing the document using output method="html", but I get the
&lt; encoding instead of < > and friends.
How do I make this work?
If I just throw the HTML data (it's well formed) to the document and select
the containing node's contents I get the text without any HTML Formatting.
You are probably using

<xsl:value-of select="." />

Instead, use:

<xsl:copy-of select="node()" />

If I encode it using &lt; I get the same &lt; as I put in, instead of
reversing it to <
If I put it in a CData (using < & > OR &lt;) I get &lt; !
I'm sure it's a simple question, but I've been googling for the past hour
without success.

Nov 12 '05 #2

"Julian F. Reschke" <ju************@nospam-greenbytes.de> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
Ayende Rahien wrote:
I've an XML document that has HTML data inside one of the tags (with < &
encoding as &lt; etc)
I'm Transform()ing the document using output method="html", but I get the &lt; encoding instead of < > and friends.
How do I make this work?
If I just throw the HTML data (it's well formed) to the document and select the containing node's contents I get the text without any HTML

Formatting.
You are probably using

<xsl:value-of select="." />

Instead, use:

<xsl:copy-of select="node()" />


Thanks, that works.
Nov 12 '05 #3
Hello Ayende,
You can try to use disable-output-escaping attribute to solve the problem.
For example: <xsl:value-of select="." disable-output-escaping = "yes/>

--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

"Ayende Rahien" <Ay****@no.spam> wrote in message
news:u6**************@TK2MSFTNGP12.phx.gbl...
I've an XML document that has HTML data inside one of the tags (with < & >
encoding as &lt; etc)
I'm Transform()ing the document using output method="html", but I get the
&lt; encoding instead of < > and friends.
How do I make this work?
If I just throw the HTML data (it's well formed) to the document and select the containing node's contents I get the text without any HTML Formatting.
If I encode it using &lt; I get the same &lt; as I put in, instead of
reversing it to <
If I put it in a CData (using < & > OR &lt;) I get &lt; !
I'm sure it's a simple question, but I've been googling for the past hour
without success.

Nov 12 '05 #4

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

Similar topics

119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
5
by: raz | last post by:
Greetings all. I apologize for what is almost certainly a stupid question, but I can't figure this out, and have no more time for head bashing... The short version: what is the appropriate...
4
by: IS | last post by:
At the recommendation of several people in this newsgroup I have downloaded two or three Compilers. One is the Beta version of Microsoft's Visual C++ 2005. I have entered a complete beginner code...
2
by: Ron Weldy | last post by:
I read that you don't need .cs files to deploy but I suppose if you are trying to reconstruct someone's work, you will need these files. Is that correct?
3
by: rroman | last post by:
I have a very simple form, takes information from the user, updates a SQL database, now I just want to redirect to a "Thank You For Your Time" web page within the same bowser. ASP. NET VB
6
by: Adam Smith | last post by:
I have posted this and similar questions repeatedly and can't even raise a single response. I am being led to believe that this then 'Must be a stupid question' although people say that there is no...
5
by: Alberto Salvati | last post by:
Hi, List. My company has a VERY BIG product base on db2 udb v7.x. We want to di an upgrade to v9, but.... current db has a lot of procedure (cobol..!). Therefore, we've planned to rewrite this...
2
by: Lynx101 | last post by:
Hi, Is this a stupid question? Senario: Two tables linked together with an ID number. Question: When using a combo box, which refences another table by indexed autonumber, is there a way to...
9
by: AWW | last post by:
Running XP - Visual Studio 2005 - VB Want to have duplicate projects - one safe and stable - other for experimenting Can't fine easy way to make duplicate project. Stupid question? or stupid ME?...
9
by: Alec | last post by:
Sorry guys, stupid question.... Am no programming expert and have only just started using php for creating dynamic news pages. Then I see a dynamic website without the php extension. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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...

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.