Create a data. xml
<? XML version = "1.0" encoding = "gb2312" ?>
< Myclassmates >
< Classmate >
< Name > 11 </ Name >
< Age > 11 </ Name >
</ Classmate >
</ Myclassmates >
*************************
* Display XML data in HTML
*************************
No.1 -- bound with simple data
No. 2 -- table Binding data (good)
<XML id = xmldata src = data. xml> </XML>
<Table id = xmltable datasrc = "# xmldata" datapagesize = "3">
<Theme>
<TH> name </Th> <TH> age </Th>
<Tr>
<TD> <span dataworks = "name"> </span> </TD>
<TD> <span dataworks = "Age"> </span> </TD>
</Table>
No. 3 -- display with CSS (without HTML)
Create CSS
Name {display: block; font-size: 22pt; color: # ccccff; Background-color: Red}
Age {display: block; font-size: 12pt}
Connect CSS in data. xml
<? XML-stylesheet href = "css.css" type = "text/CSS"?>
No. 4 -- display with XSL (not to mention)
No. 5 -- you can use the xmldom object of ASP, but it is not the scope discussed today.
***********************
* XML data operations
***********************
Use vbs or JS
For example
<Button onclick = "xmldata. recoreset. movefirst ()"> first </button>
<Button onclick = "If (xmldata. recordset. absoluteposition <> 1) xmldata. recordset. moveprevious ()"> Prev </button>
<Button onclick = "If (xmldata. recordset. absoluteposition <> xmldata. recordset. recodcount) xmldata. recordset. movenext ()"> next </button>
<Button onclick = "xmldata. recordset. movelast ()"> last </button>
The above No. 2 can be displayed by page:
<Button onclick = "xmltable. firstpage ()"> first </button>
<Button onclick = "xmltable. previouspage ()"> Prev </button>
<Button onclick = "xmltable. nextpage ()"> next </button>
<Button onclick = "xmltable. lastpage ()"> last </button>
SR: http://www.cnblogs.com/caca/archive/2004/07/16/25018.aspx