User Tools

Site Tools


transformation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
transformation [2016/09/08 10:08]
admin
transformation [2016/10/10 20:21] (current)
editor Added xml-stylesheet info
Line 1: Line 1:
 ====== Transforming Tasklists with Stylesheets ====== ====== Transforming Tasklists with Stylesheets ======
  
-Tasklists can be rendered in different ways by using a Transform process. The ToDoList XML file (the .tdl file) is exported in a similar but different XML format. That intermediate document is then put through an [[https://​www.google.com/​search?​q=xsl+transformation|XSL transformation]] using another file (called a stylesheet) with extension .XSL. So there is the source document, the transformation process, the XSL that describes what to do, and the result ​is a final transformed document.+Tasklists can be rendered in different ways by using a Transform process. The ToDoList XML file (the .tdl file) is exported in a similar but different XML format. That intermediate document is then put through an [[https://​www.google.com/​search?​q=xsl+transformation|XSL transformation]] using another file (called a stylesheet) with extension .XSL. So there is the source ​XML document, an intermediate XML document, the transformation process, the XSL that describes what to do, and the result ​in a final transformed document.
  
-The most common transformation is to convert the data into HTML, usually a report for clients or management. Sample XSL files are found in the installation folder under Resources\Stylesheets.+The most common transformation is to convert the data into HTML, usually a report for clients or management, though the output can be any text format including CSV or a custom format which can be imported by other applications. Sample XSL files are found in the installation folder under Resources\Stylesheets.
  
-The Transform Tasklist ​page allows entry of a Title, which is a field added to the intermediate file. The Stylesheet .xsl file can be selected from the default folder or any other.+The [[transform-tasklist-dialog|Transform Tasklist ​dialog]] ​allows entry of a Title, which is a field added to the intermediate file. The Stylesheet .xsl file can be selected from the default folder or any other.
  
 Task selection allows a subset of the entire tasklist to be exported into the intermediary file for transformation. You can Filter and/or Select desired tasks, and then come to this page to report on just those tasks. Task selection allows a subset of the entire tasklist to be exported into the intermediary file for transformation. You can Filter and/or Select desired tasks, and then come to this page to report on just those tasks.
Line 21: Line 21:
 Note that there is a Preference to "​Automatically export after saving"​. Specifying a stylesheet here will cause this transformation process to occur on every save operation. This allows you to publish the state of a tasklist to a website, network folder, or other location without manual effort. Note that there is a Preference to "​Automatically export after saving"​. Specifying a stylesheet here will cause this transformation process to occur on every save operation. This allows you to publish the state of a tasklist to a website, network folder, or other location without manual effort.
  
 +===== Assigning XSL Stylesheet to XML Files =====
  
 +As stated above, during a Transformation,​ the .tdl XML file is exported to a temporary intermediate format, and XSL is then applied to that intermediate file. In v7.1 an enhancement was made which allows the .tdl file to preserve a reference to an XSL file. So if you would prefer to operate on the raw XML data you now have the option. For example, here is the top of a typical .tdl file:
 +
 +<code xml>
 +<?xml version="​1.0"​ encoding="​utf-16"?>​
 +<?​xml-stylesheet type="​text/​xsl"​ href="​\tasks\resources\stylesheets\mystyle.xsl"?>​
 +<​TODOLIST PROJECTNAME="​Huge Project"​ FILEFORMAT="​11"​
 + ​EARLIESTDUEDATE="​0.00000000"​ LASTMOD="​42653.54420139"​
 + ​LASTMODSTRING="​10/​10/​2016 1:03 PM" NEXTUNIQUEID="​514"​
 + ​FILENAME="​Huge.tdl"​ FILEVERSION="​1956"​ APPVER="​7.0.999.2">​
 +</​code>​
 +
 +The ''​xml-stylesheet''​ tag is added manually by you with any typical text editor. ToDoList does not use this in any way and the tag is not maintained in the ToDoList application. The enhancement was simply to prevent that line from being removed on update.
 +
 +Since ToDoList ignores this line, there is no disadvantage to adding it, as long as you have XSL which operates on the raw .tdl file schema, which is similar to, but not the same as the intermediate file.
transformation.txt · Last modified: 2016/10/10 20:21 by editor