By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,947 Members | 1,594 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,947 IT Pros & Developers. It's quick & easy.

Problem to create HTML table from XML file using javascript

P: 8
Hi,
I am a complet newby in XML; I just want to create a table for datas coming from XML file
[HTML] <Study StudyNumber="3">
<Sample>
<Destination Position="D2"/>
<Source SourcePlate="P3" SourcePos="A2" sourceConc=2"/>
</Source>
</Sample>
<Sample>
<Destination Position="D12"/>
<Source SourcePlate="P5" SourcePos="C1" sourceConc=3"/>
</Source>
</Sample>
<Sample>
<Destination Position="D5"/>
<Source SourcePlate="P7" SourcePos="B1" sourceConc=1"/>
</Source>
</Sample>
</Study>[/HTML]


I have found some script for data organized like
[HTML]<Study>
<StudyNumber>3</StudyNumber>
<Sample>
<Destination>position D2</Destination>
<Source>
<SourcePlate>P3</SourcePlate>
<Source Pos>A2</SourcePos>
<SourceConc>B1</SourceConc>
</Source>
</Sample>
</Study>[/HTML]
I would like to have at the end a table containing all SourcePlate;SourcePos and SourcePos
I have the script to load the file
[HTML]<html>
<body>
<xml
src=" sample2.xml"
id="xmldso"
async="false">
</xml>[/HTML]
But I dont know how to populate the table
[HTML]<table
datasrc="#xmldso"
width="100%"
border="1">

<thead>
<th>SourcePlate</th>
<th>SourcePos</th>
<th>sourceConc</th>
</thead>

</body>
</html>[/HTML]
I would really appreciated any advice or idea
Jan 20 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.