Home  >  Article  >  Backend Development  >  XML introductory tutorial: specific analysis of XLink-XML/XSLT

XML introductory tutorial: specific analysis of XLink-XML/XSLT

黄舟
黄舟Original
2017-03-11 17:23:101988browse

XLink is an attribute-based syntax used to add links in XML documents. An XLink link can be one-way, like the A element in HTML, or it can be two-way, linking two documents in both directions, so it can go from A to B or from B to A. Each XLink element must have an xlink:type attribute indicating the type of connection. Attribute xlink:h
​                     ​ ​ ​ ​XLink is an attribute-based syntax used to add links in XML documents. An XLink link can be one-way, like the A element in HTML, or it can be two-way, linking two documents in both directions, so it can go from A to B or from B to A. Each XLink element must have an xlink:type attribute indicating the type of connection. The attribute xlink:href points to the linked resource URI.                    
XLink is an attribute-based syntax used to add links in XML documents. An XLink link can be one-way, like the A element in HTML, or it can be two-way, linking two documents in both directions, so it can go from A to B or from B to A. Each XLink element must have an xlink:type attribute indicating the type of connection. The attribute xlink:href points to the linked resource URI. The following is an example of a simple link:

<test xmlns:xlink = "http://www.w3.org/1999/xlink"

      xlink:type = "simple"

      xlink:href = "http://www.ringkee.com/xml.html">

<author>Jims</author>

<date>2005/02/18</date>

</test>


xlink:type attribute type There are six types, namely:

simple,extended,locator,arc,title,resource。

xlink:show attribute can tell the browser or application What the program should do when activating a link, it has five possible actions, which are:

  • new, display the link content in a new window.                

  • replace, display the link content in the current window.                  

  • embed, embed content at the position of the current link element.                

  • other, the action is undefined and is specified by the application.                

  • none, no action.

  • xlink:actuate attribute tells the browser when to display the link. It has four possible values:

    • onLoad, once When a link is found, it will be displayed immediately.                 

    • onRequest, only displayed when the user makes a request.                    

    • other, other tags in the document, not xlink, determine when to display it.                

    • none, not specified.

    • An example that works the same as the A element in HTML:

    • <test xmlns:xlink = "http://www.w3.org/1999/xlink"
      
            xlink:type = "simple"
      
            xlink:href = "http://www.ringkee.com/xml.html"
      
            xlink:actuate = "onRequest" 
      
            xlink:show = "replace" >
      
      <author>Jims</author>
      
      <date>2005/02/18</date>
      
      </test>
    • An example of embedding an image on a page :

    • xlink:actuate and xlink:show are optional.

    • <image xlink:type = "simple"
      
             xlink:actuate = "onLoad"
      
             xlink:show = "embed"
      
             xlink:href="http://www.ringkee.com/flower.png"
      
       width = "320" height = "240" />
    • The xlink:title and xlink:role attributes can specify the description between resources. xlink:title contains a small amount of text describing the remote resource, and xlink:role contains URI, pointing to a longer description of the resource.

The above is the detailed content of XML introductory tutorial: specific analysis of XLink-XML/XSLT. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn