用java造数据的步骤,用Java实现可保存状态的数据库生成XML树,最后一个源码(12),新手高手都看看吧,也不枉我一片苦心啊!-JSP教程,Java与XML...

6.3.3.xsl源码

1.treefunc.xsl

#foldheader{cursor:hand ;list-style-image:url(/images/fold.gif);padding-left-width:-3}

#foldinglist{list-style-image:url(/images/list.gif);list-left-width:-3}

a:link{color: #051679;text-decoration: none}

a:visited{color: #d91656;text-decoration: none}

a:hover{color: #cc0000;text-decoration: underline}

body{font-size: 10pt;}

var temp_str = thexmltreecookie;

var fl_n = 0;

temp_str = temp_str + "=";

for (i=0;i

temp_str=temp_str+"0:";

}

temp_str = temp_str.substring(0,temp_str.length-1);

fl_n = temp_str.length -17 ;

if ((document.cookie == )||(wm_readcookie(thexmltreecookie).length != fl_n)){

document.cookie = temp_str;

}

else {

var temp_s = wm_readcookie("thexmltreecookie").split(":");

for (i=0;i

if (temp_s][i] == 0){

var tb =0;

for (j=0;tb < 1;j++){

if (document.all[j] == foldinglist[i]){

tb = 1;

document.all[j-1].style.liststyleimage="url(/images/fold.gif)";

}

}

foldinglist[i].style.display="none";

}

else {

var tb =0;

for (j=0;tb < 1;j++){

if (document.all[j] == foldinglist[i]){

tb = 1;

document.all[j-1].style.liststyleimage="url(/images/open.gif)";

}

}

foldinglist[i].style.display="";

}

}

}

]]>

img1=new image()

img1.src="/images/fold.gif"

img2=new image()

img2.src="/images/open.gif"

function change(){

if(!document.all)

return;

var temp_ss =wm_readcookie("thexmltreecookie").split(":");

var temp_s = thexmltreecookie;

temp_s = temp_s + =;

if (event.srcelement.id=="foldheader") {

var srcindex = event.srcelement.sourceindex;

var nested = document.all][srcindex+1];

for (i=0;i

if (foldinglist[i] == nested){

var clickid;

clickid = "clickid="+event.srcelement.no;

document.cookie =clickid;

//alert(document.cookie);

if (temp_ss[i]==0){

temp_ss[i]=1;

}

else {

temp_ss[i]=0;

}

}

}

for (i=0;i

temp_s =temp_s+temp_ss[i]+:;

}

temp_s = temp_s.substring(0,temp_s.length-1);

document.cookie = temp_s;

//var clickid;

//clickid = "clickid="+nested;

//document.cookie = clickid;

//alert(document.cookie);

if (nested.style.display=="none") {

nested.style.display=

event.srcelement.style.liststyleimage="url(/images/open.gif)"

}

else {

nested.style.display="none"

event.srcelement.style.liststyleimage="url(/images/fold.gif)"

}

top.topframe.location.reload();

}

}

document.οnclick=change;

function wm_readcookie(name){

//如果没有cookie则返回false或者取得值并返回该值

if(document.cookie == ){

return false;

}

else {

return unescape(wm_getcookievalue(name));

}

}

function wm_getcookievalue(name){

var firstchar,lastchar;

var thebigcookie = document.cookie;

firstchar = thebigcookie.indexof(name);

if (firstchar != -1){

firstchar += name.length + 1;

// find the end of the value string (i.e. the next ;).

lastchar = thebigcookie.indexof(;, firstchar);

if(lastchar == -1) lastchar = thebigcookie.length;

// return the value.

return thebigcookie.substring(firstchar, lastchar);

}

else {

// if there was no cookie, return false.

return false;

}

}

]]>

foldheader

foldheader

foldheader

foldheader

foldheader

foldheader

foldheader

foldheader

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值