จาก Code ด้านล่าง ทำอย่างไรถึงจะสามารถกำหนดจำนวน Record ที่ต้องการให้แสดงได้ เพราะตอนนี้มันดึงมาทั้งหมดเลยครับ
###########################
Code (ASP)
<%@ Language=VBScript %>
<%
strPANURL = "http://www.moac.go.th/rss/kaset.xml"
dim xmlDom, nodeCol, oNode, oChildNode
set xmlDom = Server.CreateObject("MSXML2.Domdocument")
xmlDOM.async = False
call xmlDom.setProperty("ServerHTTPRequest", true)
xmlDom.async = false
call xmlDom.load(strPANURL)
if not xmlDom.documentElement is nothing then
set nodeCol = xmlDom.documentElement.selectNodes("channel/item")
Response.Write ("<table width=40% border=1 cellpadding=2 cellspacing=0 bordercolor=#0099CC>")
for each oNode in nodeCol
i=1
Response.Write("<tr><td>")
Response.Write("<div>" & vbCrLf)
set oChildNode = oNode.selectSingleNode("pubDate")
if not oChildNode is nothing then
strPubDate = Server.HTMLEncode(oChildNode.text)
strPubDate = replace(strPubDate, "'", "'")
strPubDate = replace(strPubDate, "&", "&")
strPubDate = replace(strPubDate, vbCrLf, "<br>")
'Response.Write("<div align=left><strong>" & strPubDate & "</div></strong><br>" & vbCrLf)
end if
set oChildNode = oNode.selectSingleNode("link")
if not oChildNode is nothing then
Response.Write(" <font size=1><a href='" & oChildNode.text & "' target='_blank' class='footer' style='color: #CC0000;'>")
strLink = "yes"
end if
set oChildNode = oNode.selectSingleNode("title")
if not oChildNode is nothing then
strTitle = Server.HTMLEncode(oChildNode.text)
strTitle = replace(strTitle, "'", "'")
strTitle = replace(strTitle, "&", "&")
strTitle = replace(strTitle, vbCrLf, "<br>")
Response.Write("" & strTitle & "")
end if
if strLink = "yes" then
Response.Write("</a><br><br>" & vbCrLf)
end if
set oChildNode = oNode.selectSingleNode("description")
if not oChildNode is nothing then
Response.Write("<div align=left>" & oChildNode.text & "</div><br/>" & vbCrLf & vbCrlf)
end if
i = i + 1
Response.Write("</div>" & vbCrLf)
Response.Write("</td></tr>")
next
else
Response.Write(strPANError & vbCrLf)
end if
Response.Write("</table></font>")
%>