Click here to Skip to main content
15,895,011 members

easy XML file to HTML table

Member 9435887 asked:

Open original thread
How do i display this .xml in .html or .asp in a basic table.

I would not like links to other sites, i'd just like the code to make it work. as ive tried every help site and cant figure it out.
XML
<category>
	<event name="Match1" date="20120908">
		<bettype bet-start-date="20120908" bet-start-time="1700">
			<bet had-value="HOME" name="Homewin" price="8/13"/>
			<bet had-value="DRAW" name="Draw" price="5/2"/>
			<bet had-value="AWAY" name="Awaywin" price="9/2"/>
		</bettype>
	</event>
	<event name="Match2" date="20120909">
		<bettype bet-start-date="20120909" bet-start-time="1600">
			<bet had-value="HOME" name="Homewin" price="13/10"/>
			<bet had-value="DRAW" name="Draw" price="85/40"/>
			<bet had-value="AWAY" name="Awaywin" price="2/1"/>
		</bettype>
	</event>
</category>

on to something like this
HTML
<tr>
		<td> </td>
		<td>Home win</td>
		<td>Draw</td>
		<td>Away Win</td>
	</tr>
	<tr>
		<td>Match1</td>
		<td>8/13</td>
		<td>5/2</font></td>
		<td>9/2</font></td>
	</tr>
	<tr>
		<td>Match2</td>
		<td>13/10</font></td>
		<td>85/40</font></td>
		<td>2/1</font></td>
	</tr>
</table>
Tags: Javascript, XML, HTML, ASP

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900