XML three display methods

zhaozj2021-02-16  100

Displaying XML can use one of three forms: associated CSS file display XML, using XSL style sheets and data island technology using XML.

1. Associated CSS file display XMLXML file content (Example1.xml): Corsair ~~ Instantrice CSS file content (example1.css): info {font-size: 48pt; font-weight: bold;} PS: What you need to pay attention is that the contents of the same name are when the CSS is associated. The style is associated, that is, INFOs in both files, CSS assigns the style of the classified INFO to the INFO field in XML.

This way, when you pass the IE to access the XML file, it automatically applies the style in the CSS file.

2. Using the XSL style sheet: XML file content (Example2.xml): Richard Choi Corsair ~~ Instantrice instantrice@126.com RR Perfect luv rrjlu@sina.com.cn scotte doesn 'T know badboy@hotmail.com XSL file content (example2.xsl):

Name ID E-mail
< / XSL: Stylesheet> Such a format similar to the HTML style is applied to the corresponding data, in fact, this method is similar to 1, is XML specifies a modified CSS format file or XSL file from a file, then actively performs a mode introduced.

3.XML data island technology XML data island technology is actually a method of introducing XML data or XML files in HTML, which is a relatively passive method for XML. Embed an instance of XML data directly in the web page (Example3.htm): Richard Choi Corsair ~~ instantrice instantrice@126.com scotte Doesn't Know badboy@hotmail.com

Name ID E-mail
Binds XML data over Table DataSRC attribute, then write out the contents of the field with the span's DataFLD. The place to be noted is that the Datasrc specified by the XML is the XML ID, and there is a ## in front.

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

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