XML Tutorial (4) - Royal Warlock (initial XSL)

xiaoxiao2021-03-06  60

Inspirational moments arrived, listened, the royal horn has sounded, Royal Warlock --XSL - played !!

Tong to say XSL (Extensible Stylesheet Language), I can't help but pull HTML out (anyway, it is used to it ^^), in HTML, there are many simple and easy tags to display data content, such as we can Set the display format of the data content via

, , and these tags can be easily judged by the name, but who is born to show data information? But our XML is not the same, and the born is used to store and send data information (laborious), so it is only possible to help other ways to display the data content, so our warlock will appear.

As a warrior, XSL will be much more powerful than we have described in the previous CSS. It consists of two ways, one way is used to convert XML text content, and the other is formatted XML text content. We can pass XSL First transform (filtering and finishing) XML data content, and define data content display mode (such as font size, color, etc.) through XSL formatting display method (such as font size, color, etc.).

Our warlock can also define a way to be used by the browser to display XML data after the conversion. At present, this method is often converting the XML element HTML element.

At the same time, XSL can also add or remove some elements to the output file (which can be understood as the power of the magic), or reintegrate these elements, and decide which elements will be displayed and how to be displayed.

Next, it is our magic display, please pay attention to watch:

E.G:

The first part, a simple XML file:

code:

JSper 008 Unknow Warlock (not a witty witch and half fairy) Show Internet Magic Which good person can provide me a job? Warlock can't afford the phone, I pay my mailbox. Is jsper@371.net My ICQ is: 12233550 Thank you for your support for me, I will continue to work hard XSL 001 The Extensible Stylesheet Language

Please save this code to mybackup.xml

The second part, the first XSL file appearing:

code:

code:

Gender:

status:

hobby:

>>

Please bring this code content Save as Aboutme.xsl

Part III. Mixed display magic

code:

Jsper < / Name> 008 Unknow Warlock (not a witty witch and half fairy) Show Internet Magic Which kind person can provide me a job? Warlock can't afford the phone, I will be jsper@371.net my ICQ is: 12233550 Thank you for your support for me, I will continue to work hard XSL 001 The Extensible Stylesheet Language Please save this code content as AboutMe.xml

When we open Aboutme.xml in your browser ... we can see the magical magic effect ^^

At this point, we have a preliminary understanding of XSL, and the depth of its depth is expected to look forward to the follow-up tutorial, thank you.

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

New Post(0)

CopyRight © 2020 All Rights Reserved
Processed: 0.061, SQL: 9