XML and xstl (Ajax)

Source: Internet
Author: User

The abbreviation of extensible markup language. 1. Data Storage 2 Data Display

HTML defects, such as data content mixing with page layout and display control, lead to excessive page expansion. After the information stored in the database is converted to the HTML document format after the interpretation of the dynamic programming language, the original format of the information has become completely invisible, this causes a lot of trouble for front-end page designers and background system program developers ...??? I don't know much about it !!!

XML can clearly separate the data content from the format of the control data display effect !!! At the same time, XML is called an extensible markup language because it allows developers to create the required tags in XML precisely because of the characteristics of XML, we can use custom tags to clearly express the relationships between data.

# Regard the data stored in the XML document as an operational tree. developers can traverse, modify, and access the data as needed.

# The biggest advantage of XML is that its data storage format is not restricted by the display format.

# Common information exchange methods.

===== Xstl extensible style sheet conversion language ====

-- Solve the problem: how to display the data in XML? (Use CSS Cascading Style Sheets. The example is as follows)

Code:
  1. // Xml1.css
  2. Sid
  3. {
  4. Color: blue;
  5. Font-size: 36;
  6. Text-indent: 2em;
  7. Display: block;
  8. }
  9. Sname
  10. {
  11. Color: red;
  12. Font-size: 24;
  13. Text-indent: 2em;
  14. Display: block;
  15. }
  16. GRE
  17. {
  18. Color: red;
  19. Font-size: 24;
  20. Text-indent: 2em;
  21. Display: block;
  22. }
  23. TOEFL
  24. {
  25. Color: red;
  26. Font-size: 24;
  27. Text-indent: 2em;
  28. Display: block;
  29. }
  30. Tse
  31. {
  32. Color: red;
  33. Font-size: 24;
  34. Text-indent: 2em;
  35. Display: block;
  36. }

 

// Test. xml

Code:
  1. <? XML version = "1.0" encoding = "UTF-8"?>
  2. <? XML-stylesheet type = "text/CSS" href = "xml1.css"?> 
  3. <Classmates>
  4. <Student>
  5. <Sid> 1 </Sid>
  6. <Sname> Figure 3 </sname>
  7. <GRE> 1700 </GRE>
  8. <TOEFL> 630 </TOEFL>
  9. <Tse> 120 </TSE>
  10. </Student>
  11. <Student>
  12. <Sid> 2 </Sid>
  13. <Sname> Li Si </sname>
  14. <GRE> 1800 </GRE>
  15. <TOEFL> 599 </TOEFL>
  16. <Tse> 110 </TSE>
  17. </Student>
  18. </Classmates>

Display Effect: display as described in the CSS stacked style table.

# Conclusion: Although CSS can well control the output style, such as color, Font, and size, it has severe limitations. For example, you cannot re-sort the elements in the document. You cannot determine and control which element is displayed and which one is not. You cannot count the data in the computing element; therefore, CSS is only applicable to final documents with relatively fixed output, which is not suitable for flexible requirements.

# CSS: relatively simple, consuming less system resources. ___ Control the display on the client.

# Xstl: memory consumption is high. ___ Process documents on the server side.

# The full name of xstl is the extended format conversion language (Extensible Stylesheet Transformation Language ). It is a language used to convert the XML document structure. The main function is to convert XML into HTML.

# If you want to extract relevant data from XML for display, you need to use the model query language provided by xstl. The so-called modular query language is a specific statement that extracts data from XML using the corresponding pattern matching rule expression.

There are three common modes: 1. Select a mode.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.