Learn XSL (7)

zhaozj2021-02-08  276

Learn the XSL style method in this issue, you can use the XSL element , , , , TEST attributes are screened to the range of elements to provide greater flexibility. The XML is the same as DHTML (dynamic HTML), and these nodes are objects, and these objects are hierarchical, and the root node begins constitutes a hierarchical tree structure, which forms a document object model DOM. Through the properties of the object, the method reaches the purpose of the access control XML node. We don't intend to explain in detail one by one here, because this can be written into a more than one tutorial, we will discuss some common methods first, in order to have a general understanding of the object method of the DOM. Note: From this issue, all examples no longer provide complete source code. If you don't understand, please read the seven phases in front of the previous group and do it. First, End () Meaning: Returns the last element in the collection. Example: Output The last resume is assumed that the XML file format is: ... ... ... ... ... The corresponding XSL file content is: ... or ...... II. Index () meaning: Returns the location of the element in the collection, the return value is an integer, where the first element returns 0 example : Return to the previous three resumes [index () $ 1: INDEX () is related to the parent element, see the case: Returns the first x / y [index () = 0] or x / y [0] in , nodeName () meaning: Returns the name of the element, that is, the marker name: select any element, if its name (ie, the tagname) is equal to "name" * [nodename () = 'name'] or * [name] four, Number () meaning: Convert to a numerical form, if not a value, return empty, required parameters example: age (agn) Resume (AGE) RESUME [Number (AGE) $ LT $ 30] or Resume [Age $ LT $ 30] 5. Nodetype () Meaning: Return the node type, the result is a value. The following is a list of return values:

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

New Post(0)