In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to achieve dynamic paging in XML. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Code:
Pages.xml
1 Sailflying A simple page 2002-1-11 17:35:33 XML theme 2 flyingbird Marry you It is painful 2001-09-06 12:45:51 irrigation essence 3 Kozi regular expression in UBB forum application of 2001-11-23 21:02:16 Web programming essence 4 Tai Yi Lang year-end classic rudder party complete manual v0.1 2000-12-08 10:22:48 Forum Irrigation District 5 mmkk Asp error message summary 2001-10-13 16:39:05 javascript script
Pages.xsl
Practical package of XML volume (3): dynamic paging body,BlueIdea,team,blue_ID,blue_name,blue_text,blue_time,blue_class {font: 12px "Arial", "Arial", "Times New Roman";} table {font-size: 12px; border: 0px double; border-color: # 99CC99 # 99CC99 # CCCCCC # CCCCCC; cellpadding:3;cellspacing:3; bgcolor:#eeeeee; text-decoration: blink} span {font-size: 12px; color: red;}. Keybutton {cursor:hand Font-size: 12px; color: # 003300; background: # ffffff; border: 0px solid;} 1) PageNum-= 1;} if (Num== "next") {if (actual combat package of PageNum XML volume (3): dynamic paging
The last page of the previous page
Serial number, name, subject, publication time classification
Explanation:
1) search.xml is a data file, so I believe everyone will have no problem.
2) search.xsl is a format file, there are several points to pay attention to.
(1) in the script:
Nodes=source.documentElement.childNodes
The function is to find all the nodes. Nodes.length is the total number of nodes that meet the condition.
SortField=document.XSLDocument.selectSingleNode ("/ / @ expr")
The purpose is to find the first node with an attribute of expr, so its corresponding node is
So the value of expr on the first onLoad is
Childnumber (this) = 2
About > < you may be more familiar with it. So & what is it? It is "and".
You can find some others in XML's book.
Parameter description:
OnePageNum: number of data displayed per page
PageNum: current number of pages
XMLPageNum: total number of pages
FirstNum: the first data value of the current page
LastNum: the last data value of the current page
(2) in the text:
We need to output the appropriate data in paging, so we use an if judgment condition to control it.
At the beginning, we are required to output only the values of the first two nodes.
Childnumber (this)
Function: returns the number of the current node in its parent node list, and the default number of the first node in the list is 1.
In paging, we judge which page it belongs to according to the number of the node.
Expr
I don't know if you have noticed, but the first two times we used test, but this one we used was expr.
There are some differences between them, and their usage is also different.
Expr ── scripting language expressions that evaluate to "true" or "false"; if the result is "true" and through test, the contents are displayed in the output (this attribute can be omitted).
Test ── source data test conditions.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 298
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.