The combination of XML and HTML (on)
Beijing University of Posts and Telecommunications
XML limitations
Currently, the content data of many web websites is stored in a database or data file. For web program developers, if you want to extract useful information from the database, the traditional method is to write a script (such as VBScript, JavaScript, CGI, ASP, Perl, etc.) to execute the database. The SQL query gets the relevant record, and then organizes the query to the HTML page to return to the client, and the user uses the browser to observe the final result.
In order to improve the flexibility and scalability of system services, the range of service objects is broader, and many business websites are provided as much as possible as much as possible as independent services. The way HTML has data in the way it is clearly not in accordance with this requirement. Therefore, store the original data in the XML document, using style single file display content is the advantage of XML technology suitable for e-commerce. However, in essence, XSL technology is not a data display, it is a format conversion technology, which is far from HTML in the display means and mode. For programmers, a more desirable solution is to combine HTML and XML technology, complementary advantages, so that true raw data can make full use of HTML, the change of HTML. skill. The XML data island is a product fusion product, which uses the
Treatment method of data island in IE
In order to be able to handle this embedded XML code HTML page, Internet Explorer 4.0 (hereinafter referred to as IE 4.0) introduces DSO (Data Source Objects, Data Source Object) technology, implemented with Java Applet.
E.g:
book>
book>
booklist>
Xml>
At this time, the ADO record set after the map is:
Title ISBN
Straight Talk About Computers 72-80088-005
Gourmet microwave 72-80081-082
2. Binds with HTML elements
After embedding the data island in the HTML document, you can bind the XML data island to the HTML element. Each DSO entry (ie, data island) has a unique ID number. First set the DataSRC attribute in the HTML element to the corresponding ID, you can link the HTML element and the data island. Then by setting the DataFld property value to determine the extracted XML element.
For example, the code binds to the DIV element is as follows:
Note: Not all HTML elements can be bound to XML data island. Currently, the elements that support this DSO binding mechanism are as follows:
A, Applet, Button, Div, Frame, IFRAME, IMG, INPUT (here: Checkbox, Hidden, Label, Password, Radio, and Text), Label, Marquee, SELECT, SPAN, TABLE, and Textarea.
3. Explicit XML data in a table
If the XML data is bound to the Table element, you can automatically display a multi-line form.
For example, the code that XML data is bound to the Table element is as follows: