CodeDownload
ArticleSummary:
- Related concepts;
- Use of recordset;
- Use XML data island and XSLT to convert the output style;
I. Several simple concepts:
- DSO (data source object): xml dso is a Microsoft ActiveX Control embedded in Microsoft Internet Explorer;
- XML data island: the XML data bound between the <XML> and </XML> tags is called XML data island;
2. DSO stores all records in the recordset object, and the attributes and methods of the recordset object can be used for Operation Records. The following instance feels similar to detalsview:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml"> Similar to the gridview implementation:
<XML src = "books. XML "id =" mybook "> </XML> <Table datasrc =" # mybook "border =" 1 "> <thead> <tr> <TD> name </TD> <TD> author </TD> <TD> price </TD> </tr> </thead> <tr> <TD> <Div dataworks = "title"> </ div> </TD> <Div dataworks = "authorname"> </div> </TD> <Div dataworks = "price"> </div> </TD> </tr> </table>
3. Convert the output style:
First, two XML data islands are required.
<XML src = "books. xml" id = "mybook"> </XML> <XML src = "effectfile. XSLT" id = "stylesheet"> </XML>
Then
VaR xmldso = mybook. xmldocument; var xsldso = stylesheet. xmldocument; divresults. innerhtml = xmldso. transformnode (xsldso );
Final output:
philosophy Marx 100 Computer Science and Technology Bill Gates 200 . net crayon 150