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:
Title |
Artist |
Order-by = "ARTIST">
|
|
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: