A low-level error, XPathand

zhaozj2021-02-16  83

Yesterday I did a mistake, I checked the program, but there is no problem, check the XSLT file, find the problem, this is a relatively low mistake. Xpath path selection error. First, the structure of the program is explained, and the data record is in the MS SQL2000, using the ASP to access the database, show it, because this is a grading tree structure, so I use XML as the structure of the data set, but not using RecordSet. Its XML structure is as follows:

One XML instance documentation it produces is as follows: On the display of the web page, I use XSLT to convert the XML data set to the HTML document, and the results show that this is a table with a hierarchical structure. Because the @Score property of the leaf node can be edited by the user, the parent node needs to count the @score of the leaf node, the web page provides a commit button, only after commit, the program recalculates the total score, record the database, before the submission score Use XSLT to recalculate the @score on the parent node and refresh the information of the table area. The sub-node fraction and expression in XSLT should be: sum (* / @ score), but in the path selection, I made a mistake, I wrote it into SUM (* @ score). Path * / @ score Indicates the @Score property collection path in the current child node * @ Score indicates the @Score property in all future generations of the current node

The wrong XSLT calculates the @Score in the node of the ID 5 to 23

The difference between XPath, / and // is a selection child node, a selection procealer, so the calculation results have an error.

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

New Post(0)