如何把XML连接到HTML上?
考虑下面的XML文件:
<universities>
<university>
<name>UCSB</name>
<location>Santa Barbara, CA</location>
</university>
<university>
<name>University of Texas at Arlington</name>
<location>Arlington, TX</location>
</university>
<university>
<name>USM</name>
<location>Hattiesburg, MS</location>
</university>
<university>
<name>Baylor</name>
<location>Waco, TX</location>
</university>
</universities>
可以用以下的HTML把这个XML连接到一个重复表中:
<XML ID=XMLDoc src="universities.XML"></XML>
<TABLE DATASRC="#XMLDoc" BORDER=1>
<THEAD><TH>NAME</TH><TH>LOCATION</TH></THEAD>
<TR>
<TD><SPAN DATAFLD="name"></SPAN></TD>
<TD><SPAN DATAFLD="location"></SPAN></TD>
</TR>
</TABLE>
这里不需要<APPLET> 或 <OBJECT>标签,因为XML DSO已经为你完成了这些工作
<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>