How to change the output extension when transforming with a stylesheet

Questions about writing stylesheets for transforming (Tools > Transform Tasklist) your tasklist

Moderator: abstr

Post Reply
Adventurer1111
Posts: 38
Joined: Sat Sep 26, 2020 7:41 pm

How to change the output extension when transforming with a stylesheet

Post by Adventurer1111 » Wed Oct 14, 2020 7:32 am

Hi,

Is anybody using this feature?

I've setup an XSL to convert the ToDoList into the todo.txt format. This is so that I can sync the transformed file to my phone to use with SimpleTask.

The only problem is that the file extension is .html, and there seems to be no way to change that. Any ideas?

User avatar
abstr
Site Admin
Posts: 368
Joined: Sun Jul 28, 2019 12:22 pm

Re: Automatically Export After Saving

Post by abstr » Fri Oct 16, 2020 12:27 am

It should be as simple as adding the following at the top of your stylesheet just below the '<xsl:stylesheet ...>' line:

Code: Select all

<xsl:output media-type="text/txt"/>
Let me know how it goes...

Adventurer1111
Posts: 38
Joined: Sat Sep 26, 2020 7:41 pm

Re: How to change the output extension when transforming with a stylesheet

Post by Adventurer1111 » Fri Oct 16, 2020 6:34 am

Hi abstr,

I found a different way by accident which works.

This is specifically for the "Automatically export after saving" feature.

Select the "HTML format" option - set the stylesheet, then select "Other Format" - Plain Text. The stylesheet is used and the file extension is .txt.

I'm sure that this is not intentional behavior but it works.

User avatar
abstr
Site Admin
Posts: 368
Joined: Sun Jul 28, 2019 12:22 pm

Re: How to change the output extension when transforming with a stylesheet

Post by abstr » Sun Oct 18, 2020 6:53 am

>> I'm sure that this is not intentional behavior but it works.

Nevertheless, I suggest you use the offered solution, because inevitably I will find and fix the faulty behaviour and then your workflow will break.

Post Reply