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

XSL <> converted into &lt; and &gt; in final HTML

I am having trouble having Google Adsense code stored in XSL converted
properly into HTML. The <> unfortunately become &lt; and &gt; and then
no longer work.

XSL code is:

<script type="text/javascript">
<![CDATA[
<!--
google_ad_client = "pub-5065036055322567";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_page_url = document.location;
google_color_border = "0000FF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "000000";
//-->
]]>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Resulting HTML code is:

<script type="text/javascript">
&lt;!--
google_ad_client = "pub-5065036055322567";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_page_url = document.location;
google_color_border = "0000FF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "000000";
//--&gt;
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

How do I fix this?

I get a similar problem when I try to have an XML description containing
html tags properly included into the meta description:

XML:
<meta name="description">
<xsl:attribute name="content">
<xsl:value-of select="definition"/>
</xsl:attribute>
</meta>
</meta>
XSL:
<meta name="description">
<xsl:attribute name="content">
<xsl:value-of select="definition"/>
</xsl:attribute>
</meta>
Results in HTML:
<meta name="description" content="&#xA; the &lt;a
href=&quot;../Activities.html&quot;&gt;activity&lt;/a&gt; consisting of
the cohesive collection of all&#xA; &lt;a
href=&quot;../../Tasks/Tasks.html&quot;&gt;tasks&lt;/a&gt; that are
primarily performed to produce the&#xA; &lt;a
href=&quot;../../../WorkProducts/RequirementsSet/Requirements/Requirements.html&quot;&gt;requirements&lt;/a&gt;
and other&#xA; &lt;a
href=&quot;../../../WorkProducts/RequirementsSet/RequirementsSet.html&quot;&gt;requirements
work products&lt;/a&gt; for an&#xA; &lt;a
href=&quot;../../../Endeavors/Endeavors.html&quot;&gt;endeavor&#xA;
&lt;/a&gt;"/>

How do I fix this so that it is properly included?

Jul 20 '05 #1
2 10522
Hi,
I am having trouble having Google Adsense code stored in XSL converted
properly into HTML. The <> unfortunately become &lt; and &gt; and then
no longer work.
What you are looking for is a way to disable output escaping.
XSL code is:

<script type="text/javascript">
<![CDATA[
<!--
google_ad_client = "pub-5065036055322567";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_page_url = document.location;
google_color_border = "0000FF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "000000";
//-->
]]>
</script>
From a (X)HTML point of view, I think this is a better (only valid?) way to include scripts in a document:
<script type="text/javascript">
<![CDATA[
google_ad_client = "pub-5065036055322567";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_page_url = document.location;
google_color_border = "0000FF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "0000FF";
google_color_text = "000000";
]]>
</script>
Resulting HTML code is:
How do I fix this?
specify the 'cdata-section-elements' attribute:
<xsl:output cdata-section-elements="script"/>

I get a similar problem when I try to have an XML description containing
html tags properly included into the meta description:

Extract from the XSLT1.0 recommendation:
"It is an error for output escaping to be disabled for a text node that is used for something other than a text node in the result tree."
In this case, you try disbaling output escaping on an attribute. It is not possible with XSLT1.0
How do I fix this so that it is properly included?

AFAIK, the output returned is the only valid way to use '<' and '>' in attributes, so there isn't anything to 'fix'.
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
Spread the wiki (http://www.wikipedia.org)
Jul 20 '05 #2
Donald Firesmith wrote:
I am having trouble having Google Adsense code stored in XSL converted
properly into HTML. The <> unfortunately become &lt; and &gt; and then
no longer work.


http://www.ucc.ie/xml/#usecdata

///Peter
--
"The cat in the box is both a wave and a particle"
-- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
Jul 20 '05 #3

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

Similar topics

12
by: Sammy | last post by:
Hi, my mind is going crazy. I have tried everything I can think of to no avail. I have tried Disable Output Escaping. I tried to think of a way of enclosing the attribute data in a CDATA...
4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
2
by: Francesco Moi | last post by:
Hello. I designed a form to edit some DataBase's fields. But some of these fields contain '&lt;' and '&gt;' characters. And these characters are '<' and '>' in HTML. So if want to edit these...
3
by: shaun roe | last post by:
a follow up with new problems from my previous post: I have xml encoded in a string with elements like &lt;myElement/&gt; e.g <codeFragment> &lt;myElement&gt;some text&lt;/myElement&gt; </codeFragment> I...
6
by: tentstitcher | last post by:
Hi all: I have a source xml document with an element of type string. This element contains something like the following: <stringData> &lt;Header&gt; &lt;Body&gt; </stringData> I would like to apply an...
0
by: JimL | last post by:
If you have problems with ASP.NET AJAX not working as expected, check that the expected script is being rendered in the final HTML. If not, and in general ensure that you do *not* have tag ...
3
by: webmasterATflymagnetic.com | last post by:
Folks, I'm struggling to put the question together, but I have this problem. I have written an HTML form that I can use for data entry. This uses PHP to write a SQL UPDATE command that gets...
1
by: VaidehiPawar | last post by:
I am a beginner level in xml..my output page does not convert &gt &lt it shows something like this " &lt;b&gt;Location.&lt;/b&gt;&lt;br /&gt; &lt;UL&gt;&lt;LI&gt;Park Central New York " can anyone help? here is my code ...
17
by: Kaushal Elsner | last post by:
<contact_us_client_email> <message> &lt;!]&gt; </message> <header> <!]>From: support@blurbpoint.com </header> </contact_us_client_email>
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?
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
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...
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
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...

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.