Learn XSL (8)

zhaozj2021-02-08  277

Sometimes, we may want the XML document to add some statistics to some of the content or, if the number is numbered, it is not easy to achieve the previous knowledge. Today will introduce two new elements and so that we can easily handle this problem. meaning: Calculate script expression, output a text string syntax: Property: Language ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ , "JScript", "VBScript", "VBS", etc., default is "jscript". Meaning: Declare global variables or definition functions. Syntax: Properties: Example with : I don't know if you have an impression on the example of the fourth issue of "XML" with me. The XML document does not have a resume number, but the output has a larger number of Rome digital serial numbers. Today, I will give a slightly complex example: If we write a year-end production statistics, there is a small meter, the routine method is to calculate it in advance, do not have to be, we can only give only single statistics, A small count is statistics when it is displayed. Please find out the fifth phase of "learning XML", the XML file does not have to be modified, the modification of the XSL file is as follows: ... ...... Small Meter Total (this," Q1 ") Total (this, "q2") Total (this, "q3") Total (this, "Q4") function total (node, q) {temp = 0; Mark = '/ Document / Report / ' q; v = node.selectnodes (mark); for (t = v.nextnode (); t; t = v.nextnode ()) {TEMP = Number (T.Text);} Return Temp; / Small count value} Description: The black body portion is added, pay attention to the addition section is divided into two parts, must be placed in

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

New Post(0)