This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Using Variables to determine which node to use (ASP and XSL issue)
- To: <xsl-list at mulberrytech dot com>
- Subject: Using Variables to determine which node to use (ASP and XSL issue)
- From: "Greg Miley" <greg at neosmart dot com>
- Date: Fri, 10 Nov 2000 16:19:36 -0500
- Reply-To: xsl-list at mulberrytech dot com
- Thread-Index: AcBLW+1wT7sgqLCEQyy7jjpri4fosw==
- Thread-Topic: Using Variables to determine which node to use (ASP and XSL issue)
Here is the situation,
I have an ASP xml parser and an ASP index file.
The xml file has a structure of:
<site>
<top>
<logo>logo.gif</logo>
<title>Site Title</title>
</top>
<menu>
<home>
<name>Home</name>
<link></link>
</home>
<info>
<name>Info</name>
<link></link>
</info>
<contact>
<name>Contact</name>
<link></link>
</contact>
</menu>
<links>
<link>
<name>linkname</name>
<url>linkaddress</url>
</link>
<link>
<name>linkname</name>
<url>linkaddress</url>
</link>
</links>
<home>
<title>Home Page</title>
<content>
<section>
<title>Working with XML</title>
<author>Greg M.</author>
<body></body>
</section>
</home>
<info>
<title>Home Page</title>
<content>
<section>
<title>Working with XML</title>
<author>Greg M.</author>
<body></body>
</section>
</info>
etc.....
eventually what I would like is to have the menu be a mini form with
onclick events to submit the page
to itself (index.asp) where a 'request.form()' will be waiting for any
information to be passed to it.
I need to then pass that information to the .xsl and use that to
determin which node to display ( home, info, contact....).
I might not have looked hard enough through my books, but right now my
egg is smoking.
here is a sample of where the content will actually go.
<xsl:template match="/site/menu">
<table cellpadding="0" cellspacing="0" border="0"
width="600">
<tr><td valign="top">
<table cellpadding="0" cellspacing="2"
width="100%"><tr><td>
<table cellpadding="3" border="2"
cellspacing="0" bordercolor="000000" width="120" height="200">
<tr><td bgcolor="9090FF" style="font-size:
10"><font face="verdana"><b>menu</b></font></td></tr>
<tr><td bgcolor="CCCCCC" height="100%"
valign="top" style="font-size: 10"><font face="verdana"><b>
<xsl:for-each select="*">
<a>
<xsl:attribute name="href"><xsl:value-of
select="link"/></xsl:attribute>
<xsl:value-of select="name"/><br/>
</a>
</xsl:for-each>
</b></font>
</td></tr>
</table>
</td></tr></table>
</td>
<td valign="top" width="100%">
<xsl:for-each select="../home/content/*">
<table cellpadding="0" cellspacing="2"
width="100%"><tr><td>
<table cellpadding="3" border="2"
cellspacing="0" bordercolor="000000" width="100%" height="200">
<tr><td bgcolor="9090FF"
style="font-size: 10"><font face="verdana"><b>
<xsl:value-of select="title"/></b> by:
<xsl:value-of select="author"/>
</font></td></tr>
<tr><td bgcolor="CCCCCC" height="100%"
valign="top" style="font-size: 10">
<pre><font
face="verdana"><b><xsl:value-of select="body"/>
<xsl:for-each
select="body/*"><xsl:value-of select="br"/></xsl:for-each>
<br/></b></font></pre>
</td></tr>
</table>
</td></tr></table>
</xsl:for-each><br/>
<font face="verdana" size="1"
color="AAAAAA"><center>
Copyright 2000 NeoSmart.com in conjunction with
<br/>XML-1n-j00r-3y3.
Hand written and massaged by <br/><a
href="mailto:g.miley@neosmart.com">g.miley@neosmart.com</a>
</center></font>
</td><td valign="top">
<table cellpadding="0" cellspacing="2"
width="100%"><tr><td>
<table cellpadding="3" border="2"
cellspacing="0" bordercolor="000000" width="120" height="200">
<tr><td bgcolor="9090FF" style="font-size:
10"><font face="verdana"><b>links</b></font></td></tr>
<tr><td bgcolor="CCCCCC" height="100%"
valign="top" style="font-size: 10"><font face="verdana"><b>
<xsl:for-each select="../links/link">
<a target="_new">
<xsl:attribute name="href"><xsl:value-of
select="url"/></xsl:attribute>
<xsl:value-of select="name"/>
</a>
<br/>
</xsl:for-each>
</b></font>
</td></tr>
</table>
</td></tr></table>
</td></tr>
</table>
</xsl:template>
This is my first real solid attempt at an xml site so dont laugh. :)
I think I'm getting the hang of it, but I might be going at it
bass-ackwords.
Thanks for any help.
Greg Miley
Web Development
NeoSmart.com
(941) 332-4900
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list