ACTIVE SERVER PAGE > Server.CreateObject("Msxml2.DOMDocument") - RSS ÆÄÀϸ¸µå´Â ¿¹Á¦
µî·ÏÀÏ : 2019-05-24 15:33
Á¶È¸¼ö : 52,328
<?xml version="1.0" encoding="EUC-KR" ?>
<%
Response.ContentType = "text/xml"
Set xmlPars = Server.CreateObject("Msxml2.DOMDocument")
' ¿©±â¼ ºÎÅÍ rss Á¤º¸¸¦ ´ã´Â´Ù.
Set rss = xmlPars.CreateElement("rss")
rss.setAttribute "version", "2.0"
rss.setAttribute "xmlns:dc", "http://purl.org/dc/elements/1.1/"
rss.setAttribute "xmlns:sy", "http://purl.org/rss/1.0/modules/syndication/"
rss.setAttribute "xmlns:admin", "http://webns.net/mvcb/"
rss.setAttribute "xmlns:rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlPars.AppendChild(rss)
'<channel> ½ÃÀÛ
Set Channel = xmlPars.CreateElement("channel")
rss.AppendChild(Channel)
'<title>Á¤º¸
Set title = xmlPars.CreateElement("title")
Channel.AppendChild(title)
Channel.childnodes(0).text = "Á¦¸ñ" 'Á¦¸ñ
'<link>Á¤º¸
Set channel_link = xmlPars.CreateElement("link")
Channel.AppendChild(channel_link)
Channel.childnodes(1).text = "»çÀÌÆ®ÀÇ µµ¸ÞÀΠȤÀº ü³ÎÁ¦°ø Ä«Å×°í¸®ÀÇ ¸ÞÀÎÁÖ¼Ò" 'ÁÖ¼Ò
'<description>Á¤º¸
Set description = xmlPars.CreateElement("description")
Channel.AppendChild(description)
Channel.childnodes(2).text = "»çÀÌÆ® ¼³¸í" '¼³¸í
'<dc:language>Á¤º¸
Set language = xmlPars.CreateElement("dc:language")
Channel.AppendChild(language)
Channel.childnodes(3).text = "ko" '¾ð¾î
Table_Name = "[News_Board]"
ipp = 10 '¸®½ºÆ®°Ù¼ö
ipl = 10 'Page ¸®½ºÆ®°Ù¼ö
title = "aaa"
Name = "bbb"
' ex) Name = rs(1) ÀÌ·±½ÄÀ¸·Î ¤»¤»¤»
'<item> À̶ó´Â ³ëµå¸¦ Ãß°¡
Set item = xmlPars.CreateElement("item")
Channel.AppendChild(item)
' ¿©±â¼ºÎÅÍ ÇØ´ç Æ÷½ºÆ®ÀÇ ¼¼ºÎ Á¤º¸¸¦ Ãâ·Â
set title = xmlPars.CreateElement("title") '
set link = xmlPars.CreateElement("link")
set description = xmlPars.CreateElement("description")
set dcdate = xmlPars.CreateElement("dc:date")
set dcsubject = xmlPars.CreateElement("dc:subject")
item.AppendChild(title)
item.AppendChild(link)
item.AppendChild(description)
item.AppendChild(dcdate)
item.AppendChild(dcsubject)
item.childnodes(0).text = "1°³ÀÇ Æ÷½ºÆ®(°Ô½Ã±Û)ÀÇ Á¦¸ñ" 'Á¦¸ñ
item.childnodes(1).text = "°íÀ¯ ÁÖ¼Ò"
item.childnodes(2).text = "º»¹®³»¿ë" '³»¿ë Çʵå
item.childnodes(3).text = "µî·ÏÀÏ" '³¯Â¥ Çʵå
item.childnodes(4).text = "Ä«Å×°í¸® ȤÀº ºÐ·ùÇÒ ¼ö ÀÖ´Â Å×±×¸í µî..." 'ºÐ·ù Çʵå
' ¸¶Áö¸·À¸·Î ÃÖÁ¾ÀûÀ¸·Î »Ñ·ÁÁÖÀÚ.
Response.Write xmlPars.xml
Set xmlPars = nothing
%>