XML형식으로 전달되는 데이터 받기
<%
Dim myXml, serverURL, Xadd, strcondition
DIM DayTemp(3)
set myXml = CreateObject("Microsoft.XMLDCOM") ' XML 변수선언
myXml.async = false
myXml.setProperty "ServerHTTPRequest", True ' HTTP 경로
serverURL = http://www.google.co.kr/ ' XML 파일 경로
myXml.Load(serverURL)
if myXml.parseError.errorCode <> 0 then ' 데이터 Loading 확인
response.write("ERROR")
else
set Xadd = myXml.documentElement.selectSingleNode("//current_conditions") ' //current_conditions 노드 데이터 얻기
strcondition = Xadd.selectSingleNode("condition").Attributes(0).text
for i = 1 to 3
Set Xadd = myXml.documentElement.selectSingleNode("//forecast_conditions["&i&"]") ' //forecast_conditions["&i&"] 노드가 여러개일경우
DayTemp(i) = Xadd.selectSingleNode("day_of_week").Attributes(0).text
Next
set Xadd = nothing
set myXml = Nothing
%>
'먹고 사는 일 > Web' 카테고리의 다른 글
RSS 가져오기 (HTML 가져오기) (0) | 2010.02.12 |
---|---|
ASP Error Check (0) | 2010.02.12 |
ActiveX 추가하기 (javascript) (0) | 2010.02.12 |
VB Script DB 연결 (0) | 2010.02.12 |
java script 이용 객체 hidden (0) | 2010.02.12 |