Can someone do me a kindness and have a look at a script i have embedded within my xsl stylesheet - basically all i want is a small vertical scroller (manual) which i can change the colour of the text, add images etc - simple?! ha!(getting the text from XML not a separate .txt or .html file:
<!-- SCROLLER STARTS HERE -->
<xsl:element name="script">
<xsl:attribute name="language">JavaScript1.2</xsl:attribute>
iens6=document.all||document.getElementById
ns4=document.layers
//specify speed of scroll (greater=faster)
var speed=5
//if (iens6){
//document.write('<div id="container" style="position:relative;width:170;height:160;border:1px solid
//black;overflow:hidden"/>')
//document.write('<div id="content" style="position:relative;width:165;left:0;top:0"/>')
//}
</xsl:element>
<div id="container" style="position:relative;width:170;height:160;border:1px solid black;overflow:hidden">
<div id="content" style="position:relative;width:165;left:0;top:0">
<ilayer name="nscontainer" width="170" height="160" clip="0,0,170,160">
<layer name="nscontent" width="165" height="160" visibility="hidden">
<!--INSERT HTML CONTENT HERE-->
<xsl:apply-templates select="//MedicalHistory"/>
<!--END HTML CONTENT-->
</layer>
</ilayer>
</div>
</div>
<!--
<xsl:element name="script">
<xsl:attribute name="language">JavaScript1.2</xsl:attribute>
if (iens6)
document.write('</div></div>')
</xsl:element>
-->
<table width="175px"><td><p align="right">
<a href="#" onMouseover="moveup()" onMouseout="clearTimeout(moveupvar)"><img src="/medicare_files/scrollup.gif"
border="0"/></a> <a href="#" onMouseover="movedown()" onMouseout="clearTimeout(movedownvar)"><img
src="/medicare_files/scrolldown.gif" border="0"/></a></p></td>
</table>
<xsl:element name="script">
<xsl:attribute name="language">JavaScript1.2</xsl:attribute>
if (iens6){
var crossobj=document.getElementById? document.getElementById("content"
: document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}
function movedown(){
if (iens6 && parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed
else if (ns4 && crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",100)
}
function moveup(){
if (iens6 && parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed
else if (ns4&& crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",100)
}
function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}
window.onload=getcontent_height
</xsl:element>
<!-- SCROLLER ENDS HERE -->
if i leave the &'s in i get:
org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
if i replace them with "&" i get
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
i must admit its taken all day to get a simple vertical scroller on the page. I mean all day like 7 hours - i'm beginning to lose it.
Any ideas / solutions would be so very gratefully received - maybe if it works i'll send some beers over! God this is getting me down - i've begun to realise that IT may not be for me. Please pass me my gun!!!!!
Cheers
Relisys
<!-- SCROLLER STARTS HERE -->
<xsl:element name="script">
<xsl:attribute name="language">JavaScript1.2</xsl:attribute>
iens6=document.all||document.getElementById
ns4=document.layers
//specify speed of scroll (greater=faster)
var speed=5
//if (iens6){
//document.write('<div id="container" style="position:relative;width:170;height:160;border:1px solid
//black;overflow:hidden"/>')
//document.write('<div id="content" style="position:relative;width:165;left:0;top:0"/>')
//}
</xsl:element>
<div id="container" style="position:relative;width:170;height:160;border:1px solid black;overflow:hidden">
<div id="content" style="position:relative;width:165;left:0;top:0">
<ilayer name="nscontainer" width="170" height="160" clip="0,0,170,160">
<layer name="nscontent" width="165" height="160" visibility="hidden">
<!--INSERT HTML CONTENT HERE-->
<xsl:apply-templates select="//MedicalHistory"/>
<!--END HTML CONTENT-->
</layer>
</ilayer>
</div>
</div>
<!--
<xsl:element name="script">
<xsl:attribute name="language">JavaScript1.2</xsl:attribute>
if (iens6)
document.write('</div></div>')
</xsl:element>
-->
<table width="175px"><td><p align="right">
<a href="#" onMouseover="moveup()" onMouseout="clearTimeout(moveupvar)"><img src="/medicare_files/scrollup.gif"
border="0"/></a> <a href="#" onMouseover="movedown()" onMouseout="clearTimeout(movedownvar)"><img
src="/medicare_files/scrolldown.gif" border="0"/></a></p></td>
</table>
<xsl:element name="script">
<xsl:attribute name="language">JavaScript1.2</xsl:attribute>
if (iens6){
var crossobj=document.getElementById? document.getElementById("content"
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}
function movedown(){
if (iens6 && parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed
else if (ns4 && crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",100)
}
function moveup(){
if (iens6 && parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed
else if (ns4&& crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",100)
}
function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}
window.onload=getcontent_height
</xsl:element>
<!-- SCROLLER ENDS HERE -->
if i leave the &'s in i get:
org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
if i replace them with "&" i get
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
i must admit its taken all day to get a simple vertical scroller on the page. I mean all day like 7 hours - i'm beginning to lose it.
Any ideas / solutions would be so very gratefully received - maybe if it works i'll send some beers over! God this is getting me down - i've begun to realise that IT may not be for me. Please pass me my gun!!!!!
Cheers
Relisys