When you encounter XML files similar to the following, You need to place the different months of each year under the nodes of the year. If you use the C # programming language, it is easy to implement, because there are not many XSLT files, it also took me a bit of thought. <Rows>
<Row year = "2004" month = "2"/>
<Row year = "2004" month = "5"/>
<Row year = "2005" month = "2"/>
<Row year = "2004" month = "7"/>
<Row year = "2005" month = "4"/>
<Row year = "2005" month = "8"/>
</Rows>
The idea was to define a variable to record loops, but the assignment of the variable is always not executable. It took me more than an hour to complete the process and found that it was very simple and not as complicated as the implementation of other programming languages. It is easy for users who need it. <XSL: template match = "row" mode = "month">
<Month name = "{@ month}" imageindex = "28" link = ""/>
</XSL: Template>
<XSL: template match = "row">
<XSL: variable name = "POS" select = "position ()-1"/>
<XSL: If test = "$ Pos = 0 or ../row [$ POS]/@ year! = @ Year ">
<Year name = "{@ Year}" imageindex = "26">
<XSL: Apply-templates select = "../row [@ year = Current ()/@ year]" mode = "month"/>
</Year>
</XSL: If>
</XSL: Template>