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

disable-output-escaping

Hi All,

I was wondering if someone could clear this up for me. I have
constructed a sample for a bigger problem I'm having. So, given the xml
file:

<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<test>
<p><![CDATA[<b>This is bolded</b>]]></p>
</test>

and the stylesheet:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="main" match="/">
<all_screens>
<xsl:value-of disable-output-escaping="yes" select="/test/p" />
</all_screens>
</xsl:template>
</xsl:stylesheet>

can some one twll me why the output is &lt;b&gt;This is
bolded&llt;/b&gt; instead of <b>This is bolded</b> (which is what I
thought disable-output-escaping is supposed to do)?

I've tried this with IE and Firefox and both make a mess of it.

Thanks
John

Mar 1 '06 #1
5 6403
sorry, google seems to of interpreted the &-lt-; and &-gt-; sign at the
line "why the output is"

Mar 1 '06 #2


Troot wrote:

<xsl:value-of disable-output-escaping="yes" select="/test/p" /> can some one twll me why the output is &lt;b&gt;This is
bolded&llt;/b&gt; instead of <b>This is bolded</b> ( I've tried this with IE and Firefox and both make a mess of it.


disable-output-escaping as yes is an optional feature that does not have
to be supported and usually is not supported if the XSLT processor does
not serialize the result tree. Firefox does not support
disable-output-escaping at all.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 1 '06 #3

Troot wrote:
Hi All,

I was wondering if someone could clear this up for me. I have
constructed a sample for a bigger problem I'm having. So, given the xml
file:

<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<test>
<p><![CDATA[<b>This is bolded</b>]]></p>
</test>

and the stylesheet:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="main" match="/">
<all_screens>
<xsl:value-of disable-output-escaping="yes" select="/test/p" />


Dude I could kiss you. You've just helped me out in a major way!

Mar 1 '06 #4
Troot wrote:
Hi All,

I was wondering if someone could clear this up for me. I have
constructed a sample for a bigger problem I'm having. So, given the xml
file:

<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<test>
<p><![CDATA[<b>This is bolded</b>]]></p>
</test>
Read what the FAQ has to say about CDATA first:
http://xml.silmaril.ie/authors/cdata/
and the stylesheet:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="main" match="/">
<all_screens>
<xsl:value-of disable-output-escaping="yes" select="/test/p" />
</all_screens>
</xsl:template>
</xsl:stylesheet>

can some one tell me why the output is &lt;b&gt;This is
bolded&llt;/b&gt; instead of <b>This is bolded</b> (which is what I
thought disable-output-escaping is supposed to do)?

I've tried this with IE and Firefox and both make a mess of it.


Browsers don't support disable-output-escaping. I just ran the above
through Saxon and it produced:

<all_screens><b>This is bolded</b></all_screens>

But why go to all that bother? Why not just say

<xsl:template match="/">
<all_screens>
<xsl:apply-templates select="/test/p"/>
</all_screens>
</xsl:template>

<xsl:template match="b">
<b>
<xsl:apply-templates/>
</b>
</xsl:template>

and remove the CDATA section?

///Peter
///Peter
Mar 1 '06 #5

Peter Flynn wrote:
Troot wrote:
Hi All,

I was wondering if someone could clear this up for me. I have
constructed a sample for a bigger problem I'm having. So, given the xml
file:

<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<test>
<p><![CDATA[<b>This is bolded</b>]]></p>
</test>


Read what the FAQ has to say about CDATA first:
http://xml.silmaril.ie/authors/cdata/
and the stylesheet:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="main" match="/">
<all_screens>
<xsl:value-of disable-output-escaping="yes" select="/test/p" />
</all_screens>
</xsl:template>
</xsl:stylesheet>

can some one tell me why the output is &lt;b&gt;This is
bolded&llt;/b&gt; instead of <b>This is bolded</b> (which is what I
thought disable-output-escaping is supposed to do)?

I've tried this with IE and Firefox and both make a mess of it.


Browsers don't support disable-output-escaping. I just ran the above
through Saxon and it produced:

<all_screens><b>This is bolded</b></all_screens>

But why go to all that bother? Why not just say

<xsl:template match="/">
<all_screens>
<xsl:apply-templates select="/test/p"/>
</all_screens>
</xsl:template>

<xsl:template match="b">
<b>
<xsl:apply-templates/>
</b>
</xsl:template>

and remove the CDATA section?

///Peter
///Peter


Thanks Peter and Martin, thats very helpful ;o)

Mar 2 '06 #6

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

Similar topics

5
by: Bob Bedford | last post by:
I create checkboxes using datas from a database (with PHP). I store all values in an array, as I must pass this value like a Form value. Now, in some cases, when a checkbox is selected, I must...
6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
12
by: Forti2ude | last post by:
Hello, I have a simple form... <form> <select name="foo" multiple> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select>
13
by: Rich | last post by:
Hello, So I would like to disable a textbox on a vb.net form without the text getting grayed out. In vb6 I could place a textbox control on a frame control and disable the frame leaving the...
4
by: Chris | last post by:
I have an asp.net page say page1.aspx. The form in html code is <form id = "Form1"> And i want to disable all the fields of the form after some code steps. I had created a javascript funct: ...
0
by: Ahmad Jalil Qarshi | last post by:
Hi! I have a problem while developing some webpages.The Problem is that:- How We Can Disable The Controls Of One Web Form From Other Web Form In Asp.net? Explanation:- There Should Be Two...
8
by: prado | last post by:
I want to disable a table with javascript. In this table i have 'n' record and each record has 3 buttons. If you click a button does an action. I want to disable the all table. is there any way...
4
by: Phoe6 | last post by:
Hi all, I am trying to disable the NIC card (and other cards) enabled in my machine to test diagnostics on that card. I am trying to disable it programmatic using python. I checked python wmi and...
0
by: sainiranji | last post by:
Hi All I have diffrent categories in diffrrent logging purpose and all are working fine...but now my requirment is to disable all at once . The below are change i did for disable all logges...
8
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? -----------------------------------------------------------------------...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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,...
0
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.