Recently, I like XML programming, but it is not nice enough to find many books. Recently, I like XML programming, but it is not nice enough to find many books.
Xml is good, but it is not suitable for displaying data. (More query than HTML !)
What the XML file makes does not look so beautiful, but you can still find a remedy.
XML can only focus on the description of data and file formats, and the display work is handed over to the typographical style sheet.
Typographical style table: CSS and XSL. XSL is very suitable for XML. (CSS is not discussed here !)
Start conversion now!
XSL contains two parts: XSLT and XSL Formatting Object
XSLT (XSL Transformations) is a language used to convert XML files.
XSL Formatting Object: a group of words used to format (typographical) semantics.
Step 1: Convert
The first thing the XSL processor needs to do is to read XML tags and data through the analyzer (DOM or SAX) technology.
DOM (Document Object Model) file Object Model. (DOM technology is often used in XML applications to access XML data files .)
After the browser reads the tree structure and data of XML through the xml dom object, the XML tree structure is re-ordered and combined to generate a temporary number structure. this tree structure is called the result tree.
After the result tree is generated, if a new tag or data appears, it must be merged into the result tree together.
Step 2: Format and convert
The result tree is also a tree structure. DOM technology can be used to access the data in the result tree. The data is displayed as nodes and a record style position is reserved.
The programs in the XSL processing process convert (format) the data into another Well-Formed XML file (such as WML, HTML, VoiceXML, and so on ).
It's just a small revelation.
Everyone needs to work hard. The country is vigorously promoting XML to resist Microsoft's attack. As long as you have learned XML, we will do a lot.
The above is to teach you how to quickly convert the content of an XML file through XSL. For more information, see PHP Chinese network (www.php1.cn )!