In
VB.NET WebForms do the following:
Drag an XML control onto the screen.
We'll assume the default name "Xml1"
I'm going to assume your XML is in a file called
"LearningObjectives.xml" & that you have an XSLT file called
"MyOutput.xslt"
Based on this you will need 2 properties assigned on the Xml1 control
..DocumentSource & .TransformSource
XML1.DocumentSource = <<path to LearningObjectives xml file>>
XML1.TransformSource = <<path to MyOutput xslt file>
And the code for the MyOutput.xslt is as follows:
===========================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">
<xsl:output method="html" />
<xsl:template match="/">
<HTML>
<head>
<LINK href="Styles.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != "none" ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}
</script>
</head>
<BODY>
<h3>OUTPUT</h3>
<xsl:apply-templates select="LearningObjectives"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="LearningObjectives">
<xsl:comment>
//
================================================== ====================================
// Match the lo nodes
//
================================================== ====================================
</xsl:comment>
<table border="1">
<xsl:for-each select="lo">
<tr>
<td><xsl:value-of select="Title"/></td>
<td>
<div >
<!--a onclick="switchMenu('id');">Switch it now</a-->
<a>
<xsl:attribute name="value"><xsl:value-of
select="@number"/></xsl:attribute>
<xsl:attribute name="onclick">switchMenu(value);</xsl:attribute>
+/-</a>
<div>
<xsl:attribute name="id"><xsl:value-of
select="@number"/></xsl:attribute>
<xsl:value-of select="details"/>
</div>
</div>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
===========================================