/*
Tofu is made of excellent products
Http://www.asp888.net bean curd technology station
Retain the copyright information if reprinted.
*/
Test. aspx is the main running program site. xml is an xml file containing data
<% @ Import Namespace = "System. IO" %>
<% @ Import Namespace = "System. Data" %>
<Html>
<Script language = "VB" runat = "server">
Sub Page_Load (Src As Object, E As EventArgs)
Http://www.asp888.net
Dim DS As New DataSet
Dim FS As FileStream
Dim Reader As StreamReader
FS = New FileStream (Server. MapPath ("site. xml"), FileMode. Open, FileAccess. Read)
Reader = New StreamReader (FS)
DS. ReadXml (Reader)
FS. Close ()
Dim Source As DataView
Source = new DataView (ds. Tables (0 ))
MyDataGrid. DataSource = Source
MyDataGrid. DataBind ()
End Sub
</Script>
<Body>
<H3> <font face = "Verdana"> technical site overview </font> <span runat = "server" id = "MySpan"/>
<ASP: DataGrid id = "MyDataGrid" runat = "server"
Width = "800"
BorderColor = "black"
ShowFooter = "false"
CellPadding = 3
CellSpacing = "0"
Font-Name = "Verdana"
Font-Size = "8pt"
HeaderStyle-BackColor = "# aaaadd"
>
<Property name = "Columns">
<Asp: HyperLinkColumn
DataNavigateUrlField = "url"
DataNavigateUrlFormatString = {0}
Text = "visit! "
/>
</Property>
</ASP: DataGrid>
</Body>
</Html>
Content of the site. xml file
<Root>
<Schema id = "allsite" targetNamespace = "" xmlns = "http://www.w3.org/1999/XMLSchema" xmlns: xdo = "urn: schemas-microsoft-com: xml-xdo" xdo: dataSetName = "books">
<Element name = "sites">
<ComplexType content = "elementOnly">
<Element name = "url" type = "string" minOccurs = "1" allownull = ""> </element>
<Element name = "site" type = "string" minOccurs = "1"> </element>
<Element name = "content" type = "string" minOccurs = "0" maxoccurs = "1"> </element>
</ComplexType>
</Element>
</Schema>
<Allsite>
<Sites>
<Url> http://www.asp888.net </url>
<Site> tofu </site>
<Content> tofu is made in excellent products </content>
</Sites>
</Allsite>
</Root>
Author: Tofu