Chapter 4 of the basic XSL tutorial

Source: Internet
Author: User
Tags xsl xsl file
XSL index XSL can be used to index an XML document. Where to place the index information? now let's repeat the XML documents we have seen in many previous chapters: the reference content is as follows :? Xmlversion = 1.0? CATALOGCDTITLEEmpireBurlesque/

 

XSL index

XSL can be used to index an XML document.

Where to store the index information

Now let's take a look at the XML documents we have seen in many previous chapters:
 
Reference content is as follows:
    
  
    
  
    
  
       Empire Burlesque
  
Bob Dylan
  
       USA
  
       Columbia
  
       10.90
  
       1985
  
    
  
.
  
.
  
.
  
To output the XML file as a common HTML file and index it at the same time, you only need to add an order-by attribute to the XSL file, as shown below:

The order-by attribute applies the plus sign () or minus sign (-) to define whether the application is in ascending or descending order, and uses an element name to define the elements of sorting.

Now let's take a look at the slightly adjusted XSL style sheet (or open it in IE5 ):

Reference content is as follows:
    
  
    
  
    
  
    
  
    
  
      
























                                                         Order-by = "ARTIST">                                                               
TitleArtist

  
    
  
    
  
    
  
    
  
Convert in a browser

The following is the simple code needed to convert an XML file into HTML in a browser:
  
Reference content is as follows:
    
  
    
  
    

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.