Log in   Register a New Account

Accessify Forum - Discuss Website Accessibility

New to the forum?

Only an email address is required.

Register Here

Already registered? Log In

Currently Online

No registered users are online.

Javascript in XSL

Reply with quote 1) I have this javascript in my XSL.

<script src="https://seal.verisign.com/getseal?host_name=www.sportabroad.co.uk&amp;size=S&amp;ue_flash=YES&amp;use_transparent=YES&amp;lang=en" type="text/javascript"></script>

2) The script will validate www.sportabroad.co.uk and will display verisign seal.

3) In FireFox, when I display the XSL, it only displays the verisign seal. Nothing else is displayed.

What should I do
Reply with quote Are you sure you mean XSL? (eXtensible Style Language I think).

XSL isn't generally used for font-end code, although it can be very useful as a templating language on the back-end.

When viewing the page in Firefox, I seem to get the whole page...
Reply with quote For example, my XML filename is MovBasReq.XML. In that I have dynamic data from the database. I have MovBasReq.XSL which has HTML codes and static text and header and footer details.

The following script is in XSL.

<script src="https://seal.verisign.com/getseal?host_name=www.sportabroad.co.uk&amp;size=S&amp;ue_flash=YES&amp;use_transparent=YES&amp;lang=en" type="text/javascript"></script>

the problem is to do with '&'. In DHTML version, we just use '&' but in XML/XSL version, we need to use '&amp;' instead of '&'.

Please suggest as we run out of ideas.
Reply with quote Btw, this is not an accessibility problem, so there are probably better forums to ask in.

Off the top of my head, I think you need to declare the &amp; encoding at the top of your XSL file. (There are no default encodings in XML, you have to declare them.)

But I can't see it, so difficult to tell.

[Edit: I'd missed "not" when talking about accessibility problem!]


Last edited by Alastc on 24 Aug 2007 01:48 pm; edited 1 time in total
Reply with quote Place your script call inside of a CDATA segment?
Reply with quote Could we see the entire XSLT document?
Reply with quote XSL Document

The problem area is:

<script
src="https://seal.verisign.com/getseal?host_name=www.kuoni.co.uk&amp;size=S&amp;ue_flash=YES&amp;use_transparent=YES&amp;lang=en">
</script>

================================================
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" omit-xml-declaration="yes" encoding="iso-8859-1"/>
<xsl:strip-space elements="*"/>

<xsl:include href="kugen.xsl" />
<xsl:include href="global.xsl"/>

<xsl:template match="page">

<html xmlns="http://www.w3.org/1999/xhtml">

<!--Call the page head template -->
<xsl:call-template name="template_head"/>

<body>

<!--Call the page shortcuts template-->
<xsl:call-template name="template_shortcuts"/>

<div id="page">
<!--Call the page header template-->
<xsl:call-template name="template_header"/>

<!--Call the page navigation template-->
<xsl:call-template name="template_navigation">
<xsl:with-param name="page_section" />
</xsl:call-template>

<div id="container" class="clear">
<xsl:call-template name="headP"/>

<table border="0" cellspacing="0" cellpadding="0" class="StdHdr">
<tbody>
</tbody>
</table>

<div class="StdTxtL">
<p></p>
<div class="StdTxtM">
<table class="StdTblL" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="HeadingB">Holiday Requirements</td>
<td class="HeadingHelp"><a href="javascript:Showinfowindow('/Help/holiday_requirements.html');"> Need Help?</a></td>
</tr>
</tbody>
</table>
</div>
Please complete the following details to check the availability of your holiday and make a booking or quote.
</div>

<xsl:apply-templates select="//page/requirements/MainAt"/>

<table border="0" cellspacing="0" cellpadding="0" class="StdTblL">
<tbody>
</tbody>
</table>

<div class="StdTxtL"><p><br/>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<span class="Gentext">Payment for your itinerary is by debit or credit card when you book. For your peace of mind, our site is protected by Verisign and all card payments are encrypted using the internationally accepted <a href="javascript:Showinfowindow('/popups/secure.html')" class="textlink"> Security System, SSL</a>.</span>
</td>
</tr>
</table>
<table width="135" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="135" align="center" valign="top">
<script
src="https://seal.verisign.com/getseal?host_name=www.kuoni.co.uk&amp;size=S&amp;ue_flash=YES&amp;use_transparent=YES&amp;lang=en">
</script>
<br/>
<a href="http://www.verisign.com/ssl-certificate/" target="_blank" style="color:#000000;text-decoration:none; font:bold 7px verdana,sans-serif; letter-spacing:.5px; text-align:center; margin:0px; padding:0px;">ABOUT SSL CERTIFICATES</a>
</td>
</tr>
</table>
<img height="1" width="1" src="https://switch.atdmt.com/action/outkuo_SportAbroadBookingStart_10"/></p>
</div>

<!-- <xsl:call-template name="FOO"/> -->

<!--Call the page footer template-->
<xsl:call-template name="template_footer"/>

</div>
</div>

</body>

</html>
</xsl:template>
================================================
Reply with quote So where you have:
Code:
 <!ENTITY nbsp " ">


Couldn't you add:
Code:
 <!ENTITY amp "&">
Reply with quote Even when I have the following in the XSL document, the page is not working properly.
<!ENTITY amp "&">

When I debug the XSL document with Altova XMLSpy, it works fine. In Live, it doesn't work well.
Reply with quote I place my code within CDATA segment; no luck
Reply with quote Then I would recommend asking on an XSL forum.
Reply with quote thank you very very mach Razz
__
http://ksavary.com - dream mean sogn

Display posts from previous:   

All times are GMT

  • Reply to topic
  • Post new topic