Implementing pop-up menus with XML (Figure) XML has become a Chinese language for a new generation of networks, which has gradually reflected in products of major software companies. XML itself is not a computing language, and more represents a format of a data description. Compared with HTML, it has more data-defined features, while compared to the database, it is more flexible and adapted to transmit on the network. The related technologies around XML have emerged, such as XSL, XSLT, etc., their cooperation allows us to truly start to complete some interesting tasks on XML. This article is to implement a dynamic pop-up menu on a web page at an XML beginner's perspective. For readers who are also desirable to understand the characteristics of XML and expression, it should be helpful. Application Situation We often see a variety of menu in some websites, most menus borrowed some of the features of DHTML, but it is not easy to use these existing menus to implement some own menus. The first is that some code "analysis" must be "analyzed" from their entire page, followed by the relationship between the display mode and the display content, if your menu structure and display mode are different from other websites, it will take more information. Kung Fu to study the new display method. And we want to implement a menu structure that can be dynamically adjusted, which should be available for the entire website we have to complete. Once our web page design changes, we can flexibly change the menu display, adapt to the new web page overall style. The menu we want to implement can first appear as follows: Figure 1: An appearance implementation of the pop-up menu we want to implement, after a large number of contact HTML, today's web program design we are more willing to directly put a page The like is "drawn" with the editing tool (such as FrontPage, Dreamweaver et al.), And it is no lonrecoming to design the module that can be universal. In order to achieve our goal, we start again to reconsider how to define a common menu data structure to describe information of a menu, then use a display module to express these data information, if you change some of the parameters of the display module, you can Implement different appearances and behaviors of the same menu content.
After understanding the basic definition method of XML, we define the following demonstration data: List 1: An exemplary menu data structure XML XML Version = "1.0" encoding = "gb2312"?> Xml: stylesheet type = "text / xsl" href = "menus.xsl"?>
/ TOPICS>