[サンプルXML文書を表示](下のフレームに)
XMLソース
<?xml version="1.0" encoding="Shift_JIS"?>
<?xml-stylesheet type="text/xsl" href="mousevb01.xsl"?>
<root>
<title>KodayanHomepageのサイト構成</title>
<contents>
<web>
<osaka>大阪日本橋DOS/Vプロムナード</osaka>
<css>CSSとDynamicHTML</css>
</web>
</contents>
<end>以上です(01/4/18)</end>
</root>
XSLソース
<?xml version="1.0" encoding="Shift_JIS"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="root/title"/></title>
<style type="text/css">
H4 {background-color:silver;color:red;border:thin solid green}
DIV.osaka {margin-left:2cm;color:navy}
DIV.css {margin-left:2cm;color:green}
</style>
<script type="text/vbscript">
<xsl:comment>
<![CDATA[
<!--条件判断のフラグを設定、初期値は0-->
Dim flg
flg = 0
sub ChangeColor()
if flg=0 then
ch.style.color = "red"
flg = 1
else
ch.style.color = ""
flg = 0
end if
end sub
sub osaka_onmouseover()
osaka.style.color = "red"
end sub
sub osaka_onmouseout()
osaka.style.color = ""
end sub
sub css_onmouseover()
css.style.color = "red"
end sub
sub css_onmouseout()
css.style.color = ""
end sub
]]>
</xsl:comment>
</script>
</head>
<body>
<center><H3 id="ch" onClick="ChangeColor()">
<xsl:value-of select="root/title"/></H3></center>
<HR/>
<xsl:apply-templates select="root/contents/web"/>
</body>
</html>
</xsl:template>
<xsl:template match="web">
<H4>WEBプログラミング</H4>
<DIV class="osaka" id="osaka"><xsl:value-of select="osaka"/></DIV>
<DIV class="css" id="css"><xsl:value-of select="css"/></DIV>
</xsl:template>
</xsl:stylesheet>
end(01/4/18)