Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSL <> converted into < and > in final HTML

From: "Joris Gillis" <roac@-------.-->
To: NULL
Date: 1/4/2005 9:12:00 PM
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-view.cgi?userid=38041)
Spread the wiki (http://www.wikipedia.org)


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent