+ -
当前位置:首页 → 问答吧 → 求教初级xsl,真的很初级

求教初级xsl,真的很初级

时间:2005-07-22

来源:互联网

请告诉我什么是xsl
xsl如何对xml进行格式化给个简单易懂的例子
哪里有比较全的xsl资料
非常感谢送你美图一个

作者: 忘记密码   发布时间: 2005-07-22

图不错.好象见过.  例子网上很多. 如果打算认真学最好买本相关的书.
如果只是想了解,就google吧

http://www.google.com/search?hl= ... 99%E7%A8%8B&lr=

作者: ※潇洒※   发布时间: 2005-07-23

别这么说嘛,google的当然看过了 就是太多太杂了 想要个简单易懂的例子
难道说我的图不行 再给你个好的

作者: 忘记密码   发布时间: 2005-07-23

楼主,你的图不好看啊。。要靓MM的图他才肯告诉你。。嘿嘿!!

作者: 155120699   发布时间: 2005-07-26

写了一个简单的
你可以看看
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <HTML> <HEAD> <style> .MenuList{ border:1px solid black; background-color:oldlace; width:150; } .Menu{ border:1px solid black; background-color:oldlace; display:none; width:150; } span{ background-color:oldlace; width:150; filter:alpha(opacity:150); } .head{ background-color:mistyrose; } body{ background-color:gray; } </style> <script> var oTimer=null; var i=0; function ShowAll(p){ alert(); } function mouseover(pObj,id){ pObj.style.backgroundColor="#C0C0C0"; pObj.style.border="1px solid gray"; pObj.style.cursor="hand"; showFilter(pObj,"over"); createDiv(pObj.nextSibling); } function mouseout(pObj,id){ pObj.style.backgroundColor="oldlace"; pObj.style.border="0"; pObj.style.cursor="default"; showFilter(pObj,"out"); document.all('newDiv').removeNode(true); } function showFilter(pObj,pOper){ if(pOper=="over") pObj.style.filter="alpha(Opacity=45)"; else pObj.style.filter="alpha(Opacity=150)"; } function createDiv(poDiv){ var objDiv=document.createElement("div"); objDiv=poDiv.cloneNode(true); objDiv.style.position="absolute"; objDiv.style.left=event.srcElement.offsetWidth+document.body.scrollLeft; objDiv.style.top=(event.y-objDiv.offsetHeight/2)+document.body.scrollTop; objDiv.id="newDiv"; objDiv.style.display="block"; objDiv.onmouseover=function(){ createDiv() } document.body.appendChild(objDiv); //alert(objDiv.style.display) } </script> <TITLE>List <xsl:value-of select="MENULIST/@TYPE" /></TITLE> <SCRIPT TYPE="text/javascript" LANGUAGE="javascript" SRC="list.js"></SCRIPT> </HEAD> <BODY> <BUTTON ONCLICK="ShowAll('UL');">Show All</BUTTON> <BUTTON ONCLICK="HideAll('UL')">Hide All</BUTTON> <H1>List <xsl:value-of select="MENULIST/@TYPE" /></H1> <div class="MenuList" id="MenuList"><xsl:apply-templates select="MENULIST/MENU" /></div> <P><BUTTON ONCLICK="window.alert(document.body.innerHTML);">View HTML</BUTTON></P> </BODY> </HTML> </xsl:template> <xsl:template match="MENU"> <xsl:choose> <xsl:when match=".[@ITEM=0]"> <span onmouseover="mouseover(this,id);" onmouseout="mouseout(this,id);"> <xsl:attribute name="id"> <xsl:value-of select="@TYPE" /> </xsl:attribute> <xsl:value-of select="@TYPE" /> </span> </xsl:when> <xsl:otherwise> <span onmouseover="mouseover(this,id);" onmouseout="mouseout(this,id);"> <xsl:attribute name="id"> <xsl:value-of select="@TYPE" /> </xsl:attribute> <xsl:value-of select="@TYPE" /><img src="http://msdn.microsoft.com/library/mnp/2/gif/arrowLTR.gif" style="margin-left:70"/> </span> <div class="Menu"> <xsl:attribute name="name"> <xsl:value-of select="@TYPE"/> </xsl:attribute> <xsl:if test="MENU"><xsl:apply-templates/></xsl:if> <xsl:apply-templates select="MENUITEM"/> </div> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="MENUITEM"> <span> <a target="_new"><xsl:attribute name="href"> <xsl:value-of select="ITEM_VALUE"/> </xsl:attribute><xsl:value-of select="ITEM_TITLE"/></a> </span> </xsl:template> </xsl:stylesheet>
   提示:您可以先修改部分代码再运行

作者: JSTOP   发布时间: 2005-07-27

JSTOP,你写代码一般用什么工具??

作者: 155120699   发布时间: 2005-07-27

记事本或者是Editplus

作者: JSTOP   发布时间: 2005-07-28

DreamWeaver没有用过???我觉得用DreamWeaver给网页布局很方便。

作者: 155120699   发布时间: 2005-07-28

没有用过,我喜欢手写!

作者: JSTOP   发布时间: 2005-07-28

我是喜欢偷懒……  表格 Div 先大致用 DW 布局好了再在 Ep 下改代码.

作者: ※潇洒※   发布时间: 2005-07-28