|
|
<%
Response.Write(CreateTable())
Function CreateTable()
Dim xml
Dim strCell, strRow, strTable
Dim intRow
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (Server.MapPath("NewsItems.xml"))
intRow = 1
strTable = ""
For Each objNode In xml.documentElement.selectNodes("//NewsItem")
strCell = CreateCell(objNode.SelectSingleNode("NewsTitle").text, objNode.SelectSingleNode("NewsDescription").text, intRow)
strRow = "| " + strCell + " | "
strTable = strTable + strRow + AddEmptyRow()
intRow = intRow + 1
Next
intTotalRows = intRow - 1
CreateTable = strTable
End Function
Private Function AddEmptyRow()
AddEmptyRow = "| | "
End Function
Private Function CreateCell( sTitle, sDesc, currentRow)
Dim hCell
hCell = ""
hCell = ""
hCell = hCell & " "
hCell = hCell & sDesc & " "
IF currentRow <> intTotalRows THEN
hCell = hCell & ""
END IF
CreateCell = hCell
End Function
Private Function CreateArrayList()
Dim strFunc
strFunc = ""
For i = 1 to intTotalRows
strFunc = strFunc + "items[" + Cstr(i - 1) + "] = 'item" + cstr(i) + "'" & vbcrlf
Next
CreateArrayList = strFunc
End Function
%>
|
| |
| |
|
|