C
cathy
Hi All,
I am having problems displaying content relevant to the option selected
in a drop-down menu. I have an xml document which is running content
through Flash and I need to have the same content on a web page. I am
working in Dreamweaver 8 and code in asp.net (vb).
I need to have a drop-down menu listing available news articles, when
one is selected the article should appear on the page. I have currently
managed to populate the list, but as of yet I have had no luck in
binding it to the page content. I am sure that this is quite simple,
but I am fairly new to xslt etc.
Here is my xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../news.xsl" type="text/xsl"?>
<news>
<news name="article one">
<description>Article one content</description>
<title>the full title of article one</title>
</news>
<news name="article two">
<description>Article two content</description>
<title>the full title of article two</title>
</news>
</news>
Here is my xsl:
<!-- DWXMLSource="data/news.xml" --><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" encoding="UTF-8"
doctype-public="-//W3C//XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>my page</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="newstop"><select>
<p>
<xsl:for-each select="news/news">
<option><xsl:value-of select="@name"/></option>
</xsl:for-each>
</p>
</select>
<p class="title"><xsl:value-of select="news/news/title"/></p>
</div>
<div id="news">
<p><xsl:value-of select="news/news/description"/></p>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Thanks in advance.
I am having problems displaying content relevant to the option selected
in a drop-down menu. I have an xml document which is running content
through Flash and I need to have the same content on a web page. I am
working in Dreamweaver 8 and code in asp.net (vb).
I need to have a drop-down menu listing available news articles, when
one is selected the article should appear on the page. I have currently
managed to populate the list, but as of yet I have had no luck in
binding it to the page content. I am sure that this is quite simple,
but I am fairly new to xslt etc.
Here is my xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../news.xsl" type="text/xsl"?>
<news>
<news name="article one">
<description>Article one content</description>
<title>the full title of article one</title>
</news>
<news name="article two">
<description>Article two content</description>
<title>the full title of article two</title>
</news>
</news>
Here is my xsl:
<!-- DWXMLSource="data/news.xml" --><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" encoding="UTF-8"
doctype-public="-//W3C//XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>my page</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="newstop"><select>
<p>
<xsl:for-each select="news/news">
<option><xsl:value-of select="@name"/></option>
</xsl:for-each>
</p>
</select>
<p class="title"><xsl:value-of select="news/news/title"/></p>
</div>
<div id="news">
<p><xsl:value-of select="news/news/description"/></p>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Thanks in advance.