Link _ MySQL in XHTML2.0

Source: Internet
Author: User
Link Xhtml in XHTML2.0

Almost all websites share hyperlinks. No matter whether you are a newbie or an online surfers of gaoshui products, they all rely on links to navigate on the Web. At the early stage of XML development, standard writers always regard links as an important Part of the entire context-in fact, the link specification was called "Extensible Markup Language (XML): Part 2. linking (see references ).

Web developers are very familiar with simple link tags in listing 1. the links created by the href attribute can be used for navigation, while the src attribute is used to create links that are normally loaded automatically.

Listing 1. HTML link

Title = "link to a remote page">
Alt = "link to a remote image"/>

XHTML version 2.0 retains these basic methods, but also adds some new changes. The following description is based on the XHTML July 22, 2004 Working Draft published in 2.0.

Link: starting from any element

In listing 1, an external link is defined using the (representing "anchor (anchor)" element. But most people think that the anchor is a link target, not a source. For historical reasons, element a becomes the actual method of specifying a link. In other words, there is no reason not to use other elements as the link endpoint. XHTML 2.0 relaxed this restriction and expanded the use scope of href and several other attributes.

Table cells, images, and list items can all be links. You only need to add the href attribute and specify the target URL. In fact, several attribute sets defined in XHTML 2.0 include hypertext property sets, which are applicable to each element in XHTML 2.0.

Hypertext property set

In addition to href, XHTML 2.0 also provides a set of additional attributes to further improve the link description. These attributes may be slightly modified when XHTML 2.0 enters the Last Call stage. these attributes can be used wherever href can be used.

Hreflang indicates the language required by the remote end of the link. it can be a list separated by spaces.

Hreftype indicates the media type of the link target, that is, it indicates whether it is SVG, XHTML, or other types. It can also be a list separated by spaces.

Cite indicates the source document reference of some text, usually a reference of some type. Previously, this attribute can only be used for attributes such as blockquote. Now the application scope is relaxed, and programmers can consider using more extensive methods to link hypertext. Most interestingly, the XHTML specification points out that the user agent "should" support this link in some way. The details are left to the software, but I want to see this link in a right-click menu or a more creative browser.

Access (different from accesskey in previous versions) specifies a simple name for different parts of the document, such as "contents ". Accessible tools can then properly process these parts.

The nextfocus and prevfocus attributes contain IDREF of other elements. As a whole, these forms join together to navigate the entire document, not just the navigation anchor and form control. The default navigation order is the same as the order in which elements appear in the document. these attributes can be used to adjust the navigation order more accurately. In addition, if the XHTML document references an element that contains fragments, such as a http://search.example.com # query, and the document contains a focused element with the id attribute of the query, the element receives the initial focus, and use it as the starting point for further navigation.

Target and xml: base are basically unchanged in XHTML 2.0. Web developers may have become accustomed to using the target = "_ new" rule link to open a new window. XHTML 2.0 does not hard encode any special values, but provides a standard XFrames (see references) to define how linked resources adapt to the entire environment. Xml: The base attribute setting explains the context that contains the relative URL.

An application of the hypertext property set is the navigation list, which is a new feature in XHTML 2.0, as shown in listing 2:

List 2. navigation list


  Table of Contents
 

  • Introduction to Web Forms

  •  
  • XForms Building Blocks

  •  
  • XPath in XForms

  • ...

    Navigation List helps developers guide users to visit their websites. this is a task that many developers are trying to complete through forms. However, clear hyperlink tags are more natural and accessible, and are suitable for passing navigation information.

    Embedded attribute set

    All the links discussed so far are href-style links, that is, you can click to trigger certain things. However, you may also encounter links directly loaded, especially images. XHTML 2.0 defines a set of embedded attributes.

    The typical attribute in this set is src, which contains the URL of the remote resource, which is usually transmitted when the main document is loaded and does not require special operations. Another property type provides metadata that can be viewed on the other end.

    There is a key design feature that is easily ignored: if it cannot be loaded, the linked content will replace this element; in other words, there is a built-in strain mechanism, even with multi-layer nesting, can also cope. Listing 3 shows how it works.

    Listing 3. embedded strain mechanism


     
      


  •   

  •  

    In listing 3, a navigation list is displayed in a text-only browser or a graphical browser that closes the image, but others can see the interactive image ing defined by the p element, which is described in map1. This strain behavior can be used to improve the effect of object elements, as shown in listing 4.


    Listing 4. object strain



     
     
      
    A map of the earth showing night and day
     

    After encountering the code in listing 4, the browser first tries to load the Flash applet. If it fails for some reason, the browser will try to load the JPG image. If this fails, the browser displays the inmost substitute text. Web users welcome this flexible processing method.

    Conclusion

    Certainly, the standard development around hypertext links has not yet implemented people's original ideas. However, there seems to be some progress in the end. For programmers who learn mainly by viewing source code features in browsers, XHTML 2.0 maintains friendliness to a large extent and adds some features and flexibility.

    XHTML 2.0 will enter the Last Call stage, during which the working group will solicit some constructive comments. If we follow the example of other W3C studies, this may be a long and controversial process. However, even now, XHTML 2.0 still has a positive impact, stimulating discussions about links in the Web development community. All those who have the right to speak now have come to this point and are seriously discussing it. this is a good thing.

    Only time will tell you what the final result will be. Many expect XHTML 2.0 to create a better Web

    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.