Escolar Documentos
Profissional Documentos
Cultura Documentos
XSL is a scripting language that can be used to generate HTML from data in XML form. The
Collectorz.com programs use XSL templates to show, export and print items. To do this, the
programs first create temporary XML documents containing the data for the selected item(s), then
use XSL scripts to generate the HTML page(s).
When the program starts it scans the Templates subfolder for available *.CTI files (Collectorz.com
Template Info files). These CTI files contain information about the templates (description, template
type, item type, etc..). After that the templates show up in the appropriate template selection lists
in the program, depending on the template and item types defined in the CTI files. See below for
more info about the CTI file format.
CTI format
A CTI file is a Collectorz.com Template Info file. It contains meta information about an XSL
template. It is in XML format and contains the following fields:
product: Product that can use this template. Possible values: Music, Movie, MP3, Book,
Comic
description: Template description, this text shows up in the template selection lists.
filename: Filename of the template file. Note that a possible CSS file should have the
same name.
template_type: This determines how this template can be used and in which places in the
program it will show up. Possible values:
o view: template for Details View in main screen
o print: template that defines a report for Printing
o exportindex: template for HTML index page (list page)
o exportdetails: template for HTML details page
"view"
item_type: This determines the item type for which the template can be used (e.g. Album
or Track). This only applies to export and print templates. The item_type values makes sure
track templates only show up when printing/exporting track lists. Possible values:
o 2: Main item list (= Music Album, Movie, MP3 Track, Book or Comic book)
o 3: Track list (for Music Collector), MP3 File list (for MP3 Collector)
o 5: MP3 Playlist (for MP3 Collector only)
supports_thumnails: Indicates if the template uses the thumbnails that the program
creates. For export templates only. Possible values: "yes", "no"
supports_images: Indicates if the template uses the large cover images. For export
templates only. Possible values: "yes", "no"
First, make a copy of the print_item_listall.xsl and print_item_listall.cti files and save them
in a different name, e.g. print_item_list_myfields.xsl and print_item_list_myfields.cti.
Open the print_item_list_myfields.cti file in your favourite text editor and change the
filename value (the part between <filename> and </filename>) to the name of your xsl
file, in this case: print_item_list_myfields.xsl. You may also want to change the description
value.
Now edit the print_item_list_myfields.xsl.
Remove the field headers for each field you don't want. The field headers can be found in
the part called "main template", they look like <th valign="top"
class="smallheader"> ..........</th>.
Remove the field values for the same fields. They can be found at the bottom of the file,
they look something like this: <td><xsl:value-of ........... </td>.
If you want to change order of the fields, just change the order of the header lines and
value lines. Make sure the order of headers and values matches.
Then, in your XSL template, make all "even" rows use this style, by setting the class attribute of the
TR tag, like this:
(the included print_item_list.xls file (or print_item_listpop.xls) already contains this line)
Of course, after outputting the field value, close the xsl if statement with:
</xsl:if>
Take a look at the print_item_list.xls (or print_item_listpop.xls) file for an example of this.
Important: Hiding repeating values in specific fields is only meaningful if you are hiding fields AND
sorting "from left to right", e.g. sorting on the first and second column AND hiding repeating values
in the first and second column. Hiding repeating values in unsorted fields is meaningless.