<% Randomize() choosen = Int((Rnd * 3) + 1) If choosen = 1 Then visible1 = "visible" visible2 = "hidden" visible3 = "hidden" ElseIf choosen = 2 Then visible1 = "hidden" visible2 = "visible" visible3 = "hidden" Else visible1 = "hidden" visible2 = "hidden" visible3 = "visible" End If %> <% dim oDOM, url, xml_file_name, CreateDate, NewsTitle, WebBody, LargeClass, MiddleClass, SmallClass, file_id ' XML 데이터 주소 url = "http://sports.chosun.com/topnews.xml" 'url = "http://sports.chosun.com/news/html/2010/08/31/201008310100220050000967.xml" Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0") Set oDOM = Server.CreateObject("Microsoft.XMLDOM") with oDOM .async = False ' 동기식 호출 .setProperty "ServerHTTPRequest", True ' HTTP로 XML 데이터 가져옴 .Load(url) end with Set Nodes = oDOM.getElementsByTagName("player") i = 1 For each SubNodes in Nodes If i = 1 Then name1_1 = SubNodes.getElementsByTagName("name")(0).Text team1_1 = SubNodes.getElementsByTagName("team")(0).Text score1_1 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 2 Then name1_2 = SubNodes.getElementsByTagName("name")(0).Text team1_2 = SubNodes.getElementsByTagName("team")(0).Text score1_2 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 3 Then name1_3 = SubNodes.getElementsByTagName("name")(0).Text team1_3 = SubNodes.getElementsByTagName("team")(0).Text score1_3 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 4 Then name1_4 = SubNodes.getElementsByTagName("name")(0).Text team1_4 = SubNodes.getElementsByTagName("team")(0).Text score1_4 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 5 Then name1_5 = SubNodes.getElementsByTagName("name")(0).Text team1_5 = SubNodes.getElementsByTagName("team")(0).Text score1_5 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 6 Then name1_6 = SubNodes.getElementsByTagName("name")(0).Text team1_6 = SubNodes.getElementsByTagName("team")(0).Text score1_6 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 9 Then name2_1 = SubNodes.getElementsByTagName("name")(0).Text team2_1 = SubNodes.getElementsByTagName("team")(0).Text score2_1 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 10 Then name2_2 = SubNodes.getElementsByTagName("name")(0).Text team2_2 = SubNodes.getElementsByTagName("team")(0).Text score2_2 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 11 Then name2_3 = SubNodes.getElementsByTagName("name")(0).Text team2_3 = SubNodes.getElementsByTagName("team")(0).Text score2_3 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 12 Then name2_4 = SubNodes.getElementsByTagName("name")(0).Text team2_4 = SubNodes.getElementsByTagName("team")(0).Text score2_4 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 13 Then name2_5 = SubNodes.getElementsByTagName("name")(0).Text team2_5 = SubNodes.getElementsByTagName("team")(0).Text score2_5 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 14 Then name2_6 = SubNodes.getElementsByTagName("name")(0).Text team2_6 = SubNodes.getElementsByTagName("team")(0).Text score2_6 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 17 Then name3_1 = SubNodes.getElementsByTagName("name")(0).Text team3_1 = SubNodes.getElementsByTagName("team")(0).Text score3_1 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 18 Then name3_2 = SubNodes.getElementsByTagName("name")(0).Text team3_2 = SubNodes.getElementsByTagName("team")(0).Text score3_2 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 19 Then name3_3 = SubNodes.getElementsByTagName("name")(0).Text team3_3 = SubNodes.getElementsByTagName("team")(0).Text score3_3 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 20 Then name3_4 = SubNodes.getElementsByTagName("name")(0).Text team3_4 = SubNodes.getElementsByTagName("team")(0).Text score3_4 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 21 Then name3_5 = SubNodes.getElementsByTagName("name")(0).Text team3_5 = SubNodes.getElementsByTagName("team")(0).Text score3_5 = SubNodes.getElementsByTagName("record")(0).Text ElseIf i = 22 Then name3_6 = SubNodes.getElementsByTagName("name")(0).Text team3_6 = SubNodes.getElementsByTagName("team")(0).Text score3_6 = SubNodes.getElementsByTagName("record")(0).Text End If i = i + 1 Next Set Nodes = Nothing Set oDOM = Nothing %>