Implement a tree navigation using XSLT

Source: Internet
Author: User
Tags call back xpath functions xslt

XSLT is quite good to use, and it is much easier to use than Dom to operate nodes, and built-in functions are also very convenient to use. It is used for a tree navigation, as shown below:

Although there are already a lot of tree navigation, I still want to get one by myself. I used it in my spare time. Haha, it's good. It's better to learn XSLT.

Introduce me to this semi-finished product,

First, the data in the tree navigation is stored in the XML file. You can add sub-nodes as needed for XML files like sitemap.

Second, nodes are dynamically loaded. Ajax is used in the foreground to call back parameters to the background and return subnodes. The advantage of dynamic loading is that when the data volume is too large, one-time loading is a waste of time, okay. By the way, I learned all about Ajax. It's so nice.

Once again, it uses XSLT. Although XSLT is similar to CSS, its function is not as simple as CSS. It is too powerful, easy to use, and fun, for example: you can add logical judgment in XSLT, call XPath functions, and have a template mechanism.ArticleIn "using XSLT to implement a simple tree navigation", I tried XSLT to traverse XML without Dom. It was very simple to implement it. Although I found that the whole XSLT looked messy by me later, the original simple things are actually complicated, and the last thing is constantly improved, gradually XSLTCodeThere are a lot of things, don't look at it, and even you will be dizzy.

Finally, it was a bit depressing. This was not working properly on Firefox, and it had to be enhanced in the cross-browser aspect.

If you are interested in the source code, you can send it to you for some comments and leave your email address.

Can download: http://www.elooog.cn/view.asp in this? Id = 27

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.