Recently, I like XML programming, but also suffer from its aesthetic degree and not enough, find a lot of books to finish.
It's good to use XML, but it's still not the right language for displaying data. (more than HTML to check!) )
The XML file does not look so beautiful, but it can still find a way to fix it.
XML can only focus on the description of data and file formats, and the display aspect of the work is given to the typesetting style sheet.
Layout style sheet: CSS and XSL. Where XSL is well-suited for XML. (css! not discussed here)
Now let's switch!
XSL contains two major parts: XSLT and XSL formatting Object
XSLT (XSL transformations) a language used to transform XML files.
XSL formatting Object: A set of words used to format (typesetting) semantics.
First step: Convert
The first thing an XSL processor does is read XML tags and data through the parser (DOM or sax) technology.
The DOM (Document Object model) file object model. (XML applications often use DOM technology to access XML data files.) )
When the browser reads the XML tree structure and data through the XML DOM object, the XML tree is grouped together to produce a temporary digital structure called the result tree.
After the result tree is generated, if new tags or data appear, it must be merged into the result tree.
Step two: Format the transformation
The result tree is also a tree structure that can use DOM technology to access the data of the result tree, the data is displayed as nodes, and the location of the record style is reserved.
The program in the XSL process converts these data (formatting) to another well-formed XML file (such as WML, HTML, VoiceXML, and so on).
It's over, it's just a little revelation.
We must refuel, efforts, the country is vigorously implementing XML to resist Microsoft's attack. As long as we learn XML well, we will do a good turn.