xsl-list
[Top] [All Lists]

RE: XSL Java (&amp;lt; &lt; <) problem

2004-01-06 08:40:25
&lt; would be valid in the context of XHTML -- Internet Explorer treats
XHTML as HTML and (per David Carlisle's post) &lt; would be valid in the
XHTML context, but not in the HTML context.

To resolve that, you'd need to adjust your <xsl:output> node to be along the
lines of:
        <xsl:output method="html" encoding="iso-8859-1"
omit-xml-declaration="yes" doctype-public="-//W3C//DTD HTML 4.01
Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"; />

Tweak doctypes and encodings to fit your needs (I only include them here as
a mark of "good practice" and copy & paste -- loose isn't the best doctype,
after all...)


________________________________

From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Robert A. van
Ginkel
Sent: 06 January 2004 15:15
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] XSL Java (&amp;lt; &lt; <) problem


                
Dear Rowland Shaw,
 
It seems <![CDATA[ does the same as the htmlspecialchar function in PHP
(transfer html directionchars to harmless values)
What i did (while waiting for response) turn around every Java expresion ie.
1 < 0 ? becoming 0 > 1 ? this worked.
Now I tried the <![CDATA[ variation and it gave:
function xmld(x,l)
{ var r="",c; for(i=0;i&lt;l;i++) { c = xmldate.charAt(x+i); r+=(c!="0" ||
r!="")?c:""; }
  return r;
}
so this isn't java. (&lt;)
Isn't there a xml/xsl tag that returns < at the the front end?
 
PS. I use xml with xsl now in a php processor(this is a better processor
than the one of the ie explorer + I get XHTML source back) instead of using
the <?xml-stylesheet type="text/xsl" href="example.xsl"?> directive in the
xml file.
 
Gr. Robert
www.stylegate.com
 
 
----- Original Message ----- 
From: Rowland Shaw <mailto:Rowland(_dot_)Shaw(_at_)businessobjects(_dot_)com>  
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com' 
Sent: Tuesday, January 06, 2004 12:49 PM
Subject: RE: [xsl] XSL Java (&amp;lt; &lt; <) problem


I am curious about xsl, and like it so far. I use it to make from data an
xhtml file with a xsl translation. (so I can change the look/create
different looks without changing my serverpages)
Ok so I have JavaScript in my XHTML that would make it XDHTML i think...
But when I have:

[snip]

[ERROR]
It gives an error cause in javascript i use in the for loop a < sign. ok
but if I change it in &lt; the javascript would go wrong.
How can I write clear Javascript in XSL without messing up XSL/Java and
getting errors?


Try:

(XSL)
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript"><![CDATA[
var xmldate = ']]><xsl:value-of
select="/sg/servervariables/variable[(_at_)name='servertime']" /><![CDATA[';
function xmld(x,l)
{ var r=""; for(i=x;i<(x+l);i++) { if(xmldate[i]!="0" || r!="")
{r+=xmldate[i];}
  return r;
}
 
var jdate = new Date();
var sdate = new Date(xmldr(0,4), xmldr(4,2)-1, xmldr(6,2), xmldr(8,2), ,
xmldr(10,2), , xmldr(12,2));
var plsmn = "";
alert(sdate);
]]></script>
</head><body>He hallo</body></html>
</xsl:template>
</xsl:stylesheet>

 XSL-List info and archive:  http://www.mulberrytech..com/xsl/xsl-list
<http://www.mulberrytech.com/xsl/xsl-list> 



        
Robert van Ginkel
StyleGate bv     Verspronckweg 63 SG,
2023 BB Haarlem  [ T ] +31 (0) 23 52 51 262
[ F ] +31 (0) 23 54 23 999       [ I ] www.stylegate.com
[ E ] robert(_at_)stylegate(_dot_)com   
Disclaimer
Aan dit bericht kunnen geen rechten worden ontleend. Het bericht is alleen
bestemd voor de geadresseerde. Indien dit bericht niet voor u is bestemd,
verzoeken wij u dit onmiddellijk aan ons te melden en de inhoud van het
bericht te vernietigen.

This message shall not constitute any obligations. This message is intended
solely for the addressee. If you have received this message in error, please
inform us immediately and delete its contents.  
(c)StyleGate <http://www.stylegate.com/keeptrack.php?22> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list