PDA

Click to See Complete Forum and Search --> : Loading an xml stream via asp script



spinnergy
07-12-2001, 03:26 PM
This does not seem to work:

function LoadData(sourceXML){
tempXML = new XML();
tempXML.load('x8menu.asp');
gotoAndPlay("waitForLoad");
}


Does the sourceXML have to be an xml file or can it be a script that creates one?

Here is the code in x8menu.asp:
<%
pageid = 1

function listKids(parent,level)

sqlKids = "SELECT TblWebPages.Name, TblWebPages.ID, TblWebPages.TemplateID, TblTemplates.HREF, tblwebpages.parentid, tblwebpages.pagetype, tblwebpages.isactive FROM TblWebPages, TblTemplates WHERE TblWebPages.IsActive = 'Y' AND TblWebPages.TemplateID = TblTemplates.ID AND TblWebPages.parentID = "& parent
set rsKids = conn.execute(sqlKids)

do while not rsKids.EOF %>
<item name="<%=rsKids("name")%>" face="_sans" action="getURL" target="_blank" class="child" isactive="<%=rsKids("isactive")%>" pagetype="<%=rsKids("pagetype")%>" url="<%=rsKids("href") & "?ID=" & rsKids("id")%>"><%=rsKids("name")%><%=listKids(rsKids("id"),level+1)%></item>
<%
rsKids.Movenext
Loop

rsKids.Close
set rsKids= nothing

end function
%><? xml version="1.0" ?>
<folderTree name="Site Map" face="verdana" size="12" vspace="20" indent="10">
<%
sqlBase = "SELECT TblWebPages.Name, TblWebPages.ID, TblWebPages.TemplateID, TblTemplates.HREF, tblwebpages.parentid, tblwebpages.isactive, tblwebpages.pagetype FROM TblWebPages, TblTemplates WHERE TblWebPages.IsActive = 'Y' AND TblWebPages.TemplateID = TblTemplates.ID AND TblWebPages.parentID = "& pageid
set rsBase = conn.execute(sqlBase)

do while not rsBase.eof
%>
<item name="<%=rsBase("name")%>" face="_sans" action="getURL" target="_blank" class="root" isactive="<%=rsBase("isactive")%>" pagetype="<%=rsBase("pagetype")%>" url="<%=rsBase("href") & "?ID=" & rsBase("id")%>"><%=rsBase("Name")%><%=listKids(rsBase("id"),1)%></item>
<% rsBase.Movenext
Loop
rsBase.Close
set rsBase= nothing %>
</folderTree>