본문 바로가기
Web Program/Asp Lecture

xml 데이타 읽기

by 현이빈이 2008. 9. 8.
반응형
<%

ServerURL = "http://211.41.84.92/test/news_xml.xml"

Set objXMLDOM = Server.Createobject("Microsoft.XMLDOM")

objXMLDOM.async = false

objXMLDOM.setProperty "ServerHTTPRequest", true

objXMLDOM.Load ServerURL



Set NodeList = objXMLDOM.SelectNodes("/news/news_body/news_data")



    For i = 0 To NodeList.Length-1



      Set objNode = NodeList.Item(i)

      Set objSingleNode = objNode.selectSingleNode("/news/news_body")   

      news_title = objSingleNode.getElementsByTagName("news_data").Item(i).getElementsByTagName

("news_title").Item(0).text     

      news_link = objSingleNode.getElementsByTagName("news_data").Item(i).getElementsByTagName

("news_url").Item(0).text     

      news_date = objSingleNode.getElementsByTagName("news_data").Item(i).getElementsByTagName

("news_date").Item(0).text       

     

      my_title = cut_string(news_title, 46)

      my_indate = cut_string_2(news_date, 10)

%>

                            <tr onmouseover="this.style.backgroundColor='#FBFCFF'"

onmouseout="this.style.backgroundColor='#FFFFFF'">

                              <td width="61" height="24" align="center" class="content_08"><%=i+1%></td>

                              <td width="453"><a href="<%=news_link%>" target="paran_news"><%=my_title%

></a></td>

                              <td width="91" align="center"><%=my_indate%></td>

                            </tr>

                            <tr>

                              <td height="1" colspan="4" align="center" bgcolor="#E1E1E1"></td>

                            </tr>                

<%

    next

%>
반응형