getting the names from xml file to bind the names to dropdownlist
i have a asp code in which i get an xml file.....
here is my code....
Code:
sXML2 = goBO.QueryXML("select avg(kpi) as avr, c_main from kpitable where kpi is not null group by c_main" ,"TYPES","TYPE")
if goBO.HasError then HandleError
Set oXML2 = Server.CreateObject("MSXML.DOMDocument")
oXML2.async = false
oXML2.loadXML sXML2
For each oNode2 in oXML2.documentElement.childNodes
'Phase1Desc = oXML2.documentElement.childNodes(0).getAttribute("C_MAIN")
Phase1Desc = oNode2.getAttribute("C_MAIN")
Phase2Desc = oNode2.getAttribute("AVR")
sDataPoint2 = sDataPoint2 + "+'<vc:DataPoint """ & Phase1Desc &""" """ & Phase2Desc & """ />'" + vbNewline
Next
sDataPoint2 = sDataPoint2 + "+'</vc:DataSeries.DataPoints></vc:DataSeries>'"
Set oXML2 = nothing
my xml file is:
HTML Code:
+'<vc:DataPoint "Amran Bin Abdul Latip" "1" />' +'<vc:DataPoint "Anthony Chin Min Khong" "1" />
' +'<vc:DataPoint "Asmadi Bin Abd Malek" "3" />' +'<vc:DataPoint "Cheah Sook Yee" "2" />'
+'<vc:DataPoint "Chong Swee Leong" "1" />' +'<vc:DataPoint "Choo Hwee Ping" "1" />'
+'<vc:DataPoint "Denis Thomas" "3" />' +'<vc:DataPoint "Gan Kah Soon" "2" />'
+'<vc:DataPoint "Harlina Kamal Mokhtar" "3" />' +'<vc:DataPoint "Jeffrey Khoo Hock Soon" "3" />'
+'<vc:DataPoint "Kang Yew Jin" "2" />' +'<vc:DataPoint "Leong Cheng Keong" "3" />'
+'<vc:DataPoint "Lim Poh Pen" "2" />' +'<vc:DataPoint "Mohd Amin Mahboob Ali" "2" />'
+'<vc:DataPoint "Ng Kah Wah" "2" />' +'<vc:DataPoint "Ngapiah Binti Ahmad" "2" />'
+'<vc:DataPoint "Norharfiza Puasa" "5" />' +'<vc:DataPoint "R. Hariharan" "2" />'
+'<vc:DataPoint "Rina Sarif" "1" />' +'<vc:DataPoint "Ronnie Ray Fabian" "2" />'
+'<vc:DataPoint "Rozita Mohd Zain" "2" />' +'<vc:DataPoint "Tan Kok Soon" "2" />'
+'<vc:DataPoint "Tan Sai Sung" "2" />' +'<vc:DataPoint "Tee Soong Heong" "1" />'
+'<vc:DataPoint "Tengku Nor Nasrin Tengku Mohamed" "3" />'
+'<vc:DataPoint "Thomas Leong Yew Hong" "1" />' +'<vc:DataPoint "Yap Shaw Shong" "2" />'
+'<vc:DataPoint "Yee Su Pao" "2" />' +'<vc:DataPoint "Yusnida Binti Mohamed Yunus" "3" />'
+'</vc:DataSeries.DataPoints></vc:DataSeries>
BUt i need only "c_main" means the names which are in xml file.....
but in code if i use like this am getting the names(c_main)...
Phase1Desc = oXML2.documentElement.childNodes(0).getAttribute("C_MAIN")
but i need to give near...
childnode(0)
childnode(1)
childnode(2)
childnode(3)
.....and so on
now i need to bind the names to dropdownlist......
some thing like this....
<td>Name</td>
<td>:<select id="c_main" name="c_main" >
<option value ="" selected="selected">Please Select</option>
<option value="<%= sDataPoint2%>"> </option><br/></td>
but here am not getting the names near "sDataPoint2"...
can some body help meee.....