Krishna Rajendra Alapati

IT Professional having 4+ years of experience on Java and JEE technologies. Good experience in working with Servlets, JSP, EJB2, XML, XSLT and JEE Design patterns. Good experience in working with open source frameworks like Struts, Spring, Hibernate, ANT, JUnit and JMock.

My Photo
Name:
Location: London, Ilford, United Kingdom

Monday, November 28, 2005

Good Example for Text ticker

see the below good example for text ticker with some static data

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<SCRIPT language=javaScript>
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
<!-- Beginning of JavaScript -
var thissize=11
var textfont="Verdana"

var textcolor= new Array()
textcolor[0]="EEEEEE"
textcolor[1]="DDDDDD"
textcolor[2]="CCCCCC"
textcolor[3]="AAAAAA"
textcolor[4]="888888"
textcolor[5]="666666"
textcolor[6]="555555"
textcolor[7]="444444"
textcolor[8]="333333"
textcolor[9]="222222"
textcolor[10]="111111"
textcolor[11]="000000"

var message = new Array()
message[0]="<a href=http://simplythebest.net>SimplytheBest.net</a>"
message[1]="The 'MORE INFO CHANNEL'"
message[2]="Clean look and feel, easy to browse"
message[3]="NO POPUP WINDOWS"
message[4]="The user friendly information library"
message[5]="with the popular <a href=http://simplythebest.net/software/>Shareware & Freeware directory</a>"
message[6]="an <a href=http://simplythebest.net/affiliates/>Affiliate programs directory</a>"
message[7]="the <a href=http://simplythebest.net/scripts/>DHTML scripts and Javascripts library</a>!"
message[8]="the <a href=http://simplythebest.net/music/>Music directory</a> for artists and musicians"
message[9]="<a href=http://simplythebest.net/scripts/perl_scripts/>CGI scripts collection</a>"
message[10]="the new <a href=http://simplythebest.net/drivers/>Device Drivers</a> section"
message[11]="and more......"
message[12]="<img border=0 src=../images/smallhome.gif width=111 height=29>"

var i_blurstrength=10
var i_message=0
var i_textcolor=0

function blurtext() {
if(document.all) {
if (i_blurstrength >=-2) {
if (i_textcolor >=textcolor.length-1) {i_textcolor=textcolor.length-1}
blurthis.innerHTML="<span id='blurpit1' style='position:absolute;visibility:visible;width:600px;top:5px;left:5px;filter:blur(add=0,strength="+i_blurstrength+",direction=90);font-family:"+textfont+";font-size:"+thissize+"pt;color:"+textcolor[i_textcolor]+"'>"+message[i_message]+"</span>";
document.close()
i_blurstrength=i_blurstrength-2
i_textcolor++
var timer=setTimeout("blurtext()",60)
}
else {
if (i_textcolor >=textcolor.length-1) {i_textcolor=textcolor.length-1}
blurthis.innerHTML="<span id='blurit1' style='position:absolute;visibility:visible;width:600px; top:5px;left:5px;filter:blendTrans(duration=4.2);font-family:"+textfont+";font-size:"+thissize+"pt;color:000000'>"+message[i_message]+"</span>";
i_message++
if (i_message>=message.length){i_message=0}
i_blurstrength=20
i_textcolor=0
clearTimeout(timer)
var timer=setTimeout("blurtext()",2000)
}
}
}
// - End of JavaScript - -->
</SCRIPT>
</HEAD>

<BODY onLoad="blurtext()">
<DIV id="blurthis" style="position:absolute;visibility:visible;">
</DIV>
</BODY>
</HTML>

Monday, November 21, 2005

New JavaUserGroup

Hi check this out really useful for java devolopers





JOIN

Hitech City
JUG


Hyderabad
INDIA


Getting the Table of contents for a xml using xsl

Here is a typical example to create a Table of Contents for a given particular xml


XML:


<?xml version="1.0" encoding="UTF-8"?>

<main title="Main Heading">
<section title="Heading1">
<section title="Heading1.1" >
<section title="Heading1.1.1"></section>
<section title="Heading1.1.2"></section>
</section>
<section title="Heading2" >
<section title="Heading2.1"></section>
<section title="Heading2.2"></section>
</section>
</section>
</main>

Output:

Main Heading
1)Heading1
1.1)Heading1.1
1.1.1)Heading1.1.1
1.1.1)Heading1.1.2
2)Heading2
2.1)Heading2.1
2.2)Heading2.2


Answer is here

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />

<xsl:template match="/main">
<xsl:value-of select="@title"/>
<xsl:text>
</xsl:text>
<xsl:call-template name="p">
<xsl:with-param name="prefix" select="''" />
<xsl:with-param name="indent" select="' '" />
</xsl:call-template>
</xsl:template>

<xsl:template name="p" >
<xsl:param name="prefix" />
<xsl:param name="indent" />
<xsl:for-each select="section" >
<xsl:value-of select="$indent"/>
<xsl:value-of select="$prefix"/>
<xsl:value-of select="position()"/>) <xsl:value-of select="@title" />
<xsl:text>
</xsl:text>
<xsl:call-template name="p">
<xsl:with-param name="prefix" select="concat($prefix, position(), '.')" />
<xsl:with-param name="indent" select="concat($indent, ' ')" />
</xsl:call-template>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Sunday, November 20, 2005

Hi

Hi friends

This Post i m posting from my w.blogger client