sample 방문자
<?xml version="1.0" encoding="euc-kr" ?> 
<dwi>
<Row>
<Cell MergeDown="1" Index="1">
<Data Type="String">날짜</Data> 
</Cell>
<Cell MergeAcross="1" Index="2">
<Data Type="String">페이지뷰</Data> 
</Cell>
<Cell MergeDown="1" Index="4">
<Data Type="String">방문자수</Data> 
</Cell>
<Cell MergeDown="1" Index="5">
<Data Type="String">방문당 페이지뷰</Data> 
</Cell>
</Row>
<Row>
<Cell Index="2">
<Data Type="String">페이지뷰</Data> 
</Cell>
<Cell Index="3">
<Data Type="String">비율(%)</Data> 
</Cell>
</Row>
<row_0>
<data_0>2010년 9월 24일</data_0> 
<data_1>905</data_1> 
<data_2>10.6000</data_2> 
<data_3>208</data_3> 
<data_4>4.3510</data_4> 
</row_0>
<row_1>
<data_0>2010년 9월 25일</data_0> 
<data_1>1062</data_1> 
<data_2>12.4400</data_2> 
<data_3>262</data_3> 
<data_4>4.0534</data_4> 
</row_1>
<row_2>
<data_0>2010년 9월 26일</data_0> 
<data_1>1048</data_1> 
<data_2>12.2700</data_2> 
<data_3>251</data_3> 
<data_4>4.1753</data_4> 
</row_2>
<row_3>
<data_0>2010년 9월 27일</data_0> 
<data_1>1392</data_1> 
<data_2>16.3000</data_2> 
<data_3>314</data_3> 
<data_4>4.4331</data_4> 
</row_3>
<row_4>
<data_0>2010년 9월 28일</data_0> 
<data_1>1736</data_1> 
<data_2>20.3300</data_2> 
<data_3>360</data_3> 
<data_4>4.8222</data_4> 
</row_4>
<row_5>
<data_0>2010년 9월 29일</data_0> 
<data_1>1489</data_1> 
<data_2>17.4400</data_2> 
<data_3>349</data_3> 
<data_4>4.2665</data_4> 
</row_5>
<row_6>
<data_0>2010년 9월 30일</data_0> 
<data_1>906</data_1> 
<data_2>10.6100</data_2> 
<data_3>246</data_3> 
<data_4>3.6829</data_4> 
</row_6>
</dwi>

 

요넘을 html 문서로 뿌려주는 가장 좋은 방법은 머가 있을까요?

 

========================================================================

 

[Re] 예시 -- By Yoon
<%
'객체생성
Dim objDom
Set objDom = Server.CreateObject("Microsoft.XMLDOM") 
 
'파일 경로
Dim fpath : fpath = "test.xml"
 
'파일 불러오기
With objDom
        .async = False
        .Load(Server.MapPath(fpath))
End With
 
'임시저장변수
Dim strHTML, rowspan, colspan
Dim txt, down, across, index
Dim tot_cell, cell_cnt
 
'Cell 정보 가져오기
Dim Nodes, i, j
Set Nodes = objDom.GetElementsByTagName("Row")
 
tot_cell = 0
strHTML = "<table border=1>"& vbCrlf
 
'타이틀행 구성
For i = 0 To Nodes.length - 1
        strHTML = strHTML &"<tr>"& vbCrlf
 
        cell_cnt = Nodes(i).childNodes.length
        tot_cell = tot_cell + cell_cnt
 
        For j = 0 To Nodes(i).childNodes.length - 1
              txt  = Nodes(i).childNodes(j).text
              down = Nodes(i).childNodes(j).getAttribute("MergeDown")
              across = Nodes(i).childNodes(j).getAttribute("MergeAcross")
              index = Nodes(i).childNodes(j).getAttribute("Index")
 
              IF down = "1" Then
                   rowspan = " rowspan='2'"
              Else
                   rowspan = ""
              End IF
              IF across = "1" Then
                   colspan = " colspan='2'"
              Else
                   colspan = ""
              End IF
              strHTML = strHTML &"<td"& rowspan & colspan &">"& txt &"</td>"& vbCrlf
        Next 
        strHTML = strHTML &"</tr>"& vbCrlf
Next 
 
'데이터행 구성
For i = 0 To tot_cell - 1
        Set Nodes = objDom.GetElementsByTagName("row_"&i)
        IF Nodes.length = 0 Then
              Exit For
        Else
              strHTML = strHTML &"<tr>"& vbCrlf
              For j = 0 To Nodes(0).childNodes.length - 1
                  strHTML = strHTML &"<td>"& Nodes(0).childNodes(j).text &"</td>"& vbCrlf
              Next
              strHTML = strHTML &"</tr>"& vbCrlf
        End IF  
Next
strHTML = strHTML &"</table>"& vbCrlf
Set Nodes = Nothing
 
'결과 출력
Response.write strHTML
%>