Hi,
I’m developing a 6 month rolling calendar using asp and the data (for appointments) held in an xml file.
My problem is that i need to search and bring back all records in the xml file for a particular month. At the moment it's kind of doing it, although it's only bring back the 1st record it find. Any idea how i get it to bring back all?
Examples of the code below:
my xml file looks like this:
i'm also using a xsl file:
Tha asp i'm using to load both of theses files and to get the data back is here:
your help is much appreciated
cheers
Ash
I’m developing a 6 month rolling calendar using asp and the data (for appointments) held in an xml file.
My problem is that i need to search and bring back all records in the xml file for a particular month. At the moment it's kind of doing it, although it's only bring back the 1st record it find. Any idea how i get it to bring back all?
Examples of the code below:
my xml file looks like this:
Code:
<?xml version="1.0"?>
<goodtogreat>
<agenda>
<field id="agendaid" taborder="1">
<field_value>1</field_value>
</field>
<field id="month" taborder="2">
<field_value>January</field_value>
</field>
<field id="agendetitle" taborder="3">
<field_value>Fireside Chat</field_value>
</field>
<field id="link" taborder="4">
<field_value>
</field_value>
</field>
<field id="prority" taborder="5">
<field_value>1</field_value>
</field>
</agenda>
<agenda>
<field id="agendaid" taborder="1">
<field_value>2</field_value>
</field>
<field id="month" taborder="2">
<field_value>March</field_value>
</field>
<field id="agendetitle" taborder="3">
<field_value>December, GP Good to Great Event Party </field_value>
</field>
<field id="link" taborder="4">
<field_value>
</field_value>
</field>
<field id="prority" taborder="5">
<field_value>1</field_value>
</field>
</agenda>
<agenda>
<field id="agendaid" taborder="1">
<field_value>3</field_value>
</field>
<field id="month" taborder="2">
<field_value>March</field_value>
</field>
<field id="agendetitle" taborder="3">
<field_value>Fireside Chat</field_value>
</field>
<field id="link" taborder="4">
<field_value>
</field_value>
</field>
<field id="prority" taborder="5">
<field_value>1</field_value>
</field>
</agenda>
</goodtogreat>
i'm also using a xsl file:
Code:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] version="1.1">
<xsl:template match="goodtogreat/agenda">
<ul>
<li>
<xsl:value-of select="field[@id='agendetitle']/field_value" disable-output-escaping="yes"/>
</li></ul>
</xsl:template>
</xsl:stylesheet>
Tha asp i'm using to load both of theses files and to get the data back is here:
Code:
Function loadagenda(strXMLFile, strXSLFile, strSid)
Dim objXML
Dim objNode
Dim objXSL
set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = false
objXML.load(strXMLFile)
Set objNode = objXML.SelectSingleNode("goodtogreat/agenda[field/field_value='" & strSid & "']")
if objNode is nothing then
response.Write ""
else
set objXSL = Server.CreateObject("Microsoft.XMLDOM")
objXSL.async = false
objXSL.load(strXSLFile)
Response.Write objNode.transformNode(objXSL)
End If
End Function
your help is much appreciated
cheers
Ash