Learn XSL (4)

zhaozj2021-02-08  293

One of the advantages of XML technology is the selectability of the data output, ie the data output is selected. As we mentioned in front: , and just simple selection of nodes arriving through the "/" symbolic layer, if we There is no need for XML data, but only some of them meet some of the data, "radish green, take the required", then the condition judges and multi-conditioned judgment and catering this need, if you are familiar with the programming, you will feel that they have met. The IF in XSL, first, introduce the syntax structure of the XSL element : Syntax: Property: Expr ─ Script language expression, the calculation result is "true" or "false"; if the result is "true", and via Test, it is displayed in the output (omitted this attribute). Language ─ The script language type of Expression in Expl attributes, with the value of the value of the Language property of the HTML tag Script, default is "JScript" TEST - source data test conditions.

Example: This is a report as an example, the file name is Report.xml, its contents are as follows: Jia class 50 70 30 10 B class 20 30 40 50 Class Class 70 40 20 10 We use the XSL template to combine today's , we write an XSL document, requiring the quarterly production to be less than 20, indicating that the file name is Report.xsl, the content is as follows :

1999 Production statistics
class one Quarter in the third quarter Four quarter < / XSL: Template>
<

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

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