XML data island

xiaoxiao2021-03-06  105

Data Islands

In Microsoft Internet Explorer5.0, you can use XML elements to create data islands, and the data island is an XML data referenced by the HTML page, and XML data can be included in an HTML file or within an external file.

With the XML element, we can prevent us to write a script, if the user is forbidden to execute the script due to security, the tag will not work properly. At that time, it is necessary to initialize XML and must write scripts.

Inline XML

Inline XML is included between marks and , for example:

Dragon Women

180

heroes Yang over

178

Quote XML file

Use the tag to reference the external XML file, the src property can reference the local file, or you can specify a URL, the URL points to the outside server, and the data can be integrated from several different servers. The SRC attribute of the following example references the local XML file.

The file XMLData.xml contains XML data.

The following example references the XML file on a remote server:

1/1/99

104 room

2/1/99

34 room

3/1/99

20 room

Tag

Using the DataSRC attribute reference line XML, the DatasRC property is actually achieved by adding # to the front of the ID attribute of the XML element to be processed. Since the TD element cannot bind the data, it is necessary to find an element that can bind data. In the above example, we bind to the XML element to display with the DADAFLD attribute of the DIV element, for example: datafld = "date" The value in in the XML element is bound to DIV.

When the XML element is read by the browser, a different line is created for each tag.

Steps to create an XML application:

1. Create a new XML document

2. Paste the following code to your XML document.

China

1.2 billion

Beijing

RMB ¥

United States

120,000

Washington

Meiyuan $

Germany

9 million

Berlin

Mark

3. You can add any more entries in the World National Introduction.

4. Use the data island to access the data in XML.

To apply an XML document in your HTML document, add XML data island to the page

The above code: Turn the XML file "XML_Application.xml" to the so-called "XMLAPP" data island.

Async = "false" properties effect: Make sure that any HTML processing [Resolution] is previously transferred to XML data. 5. Bind the XML file to the HTML page.

Bind XML Data to Table (HTML), in the table data, add data source properties, and add data items to the data field in the property:

National Information

Population

Capital

Currency

6. Bind XML data to HTML without a table:

To display XML data, Table is not a must, you can use the DataSource and DataField properties to bind data using DataSource and DataField property.


National Information:


Artist:


Year:

转载请注明原文地址:https://www.9cbs.com/read-123679.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.054, SQL: 9