Including Attributes in OPML export


(Richard Bullen) #1

I want to utilize $Startdate in an OPML export so that the date appears in the body of a note in the final outline.
I assume the way to do this is to include $Startdate in the OPML Item template but its not clear to me how to add the attribute.
Is there any documentation that might help me figure out the solution. Unfortunately I’m under a deadline to complete a document and don’t have a lot of time for trial and error in changing the code. And, pretty obviously I’m not a programmer.
Any pointers would be much appreciated.


(Mark Anderson) #2

Per the OPML spec there is no formal ‘Startdate’ attribute. Whilst you can put your Tinderbox $Startdate (perhaps you meand StartDate?) values into OPML export (e.g. by modifying the built-in OPML export template).

A common misconception is OPML supports any attribute you add. In fact, whilst OPML-capable processes should support the spec, further additions are app-dependent. Just adding custom attributes to your raw OPML doesn’t mean all OPML consuming apps will extract the non-standard data.


(Richard Bullen) #3

Thanks for your response.

So perhaps I need to ask a broader question:

Is there a way to get a “date” attribute into an OPML export and then have the date show up as the heading to the notes in the OPML document and subsequently in an Omnioutliner document?


(Mark Anderson) #4

I’d export a note with such a date from OmniOutliner (I don’t the the app just now), I it exports the date, it will likely import it. Adjust your Tinderbox OPML export template to reflect the layout of the OO exported OPML.

If now sure how to do that, please post a link to the OO-exported OPML.


(eastgate) #5

Sure.

Where the usual OPML export template says

^value(attributeEncode($Name))^

you’d have

^value(attributeEncode($Name)) ^value($StartDate) ^

In other words, instead of just exporting the name, export the name and the start date.


(Richard Bullen) #6

This works. I can get the date into the Omnioutliner document as I need.

One more question. In the example given above there is a space at end of the line before the last caret. Is that correct? I’m getting a stray caret when the attribute prints and I wonder if the space is necessary and perhaps the source of the problem.


(Paul Walters) #7

Try

^value(attributeEncode($Name)) ^value($StartDate)

There is one too many carets in the example.


(Mark Anderson) #8

Or

^value(attributeEncode($Name))^ ^value($StartDate)^

For infrequent users of export code, I recommend always adding the optional closing caret as it saves Tinderbox having to guess where an export code finishes.


(Richard Bullen) #9

I now have the result I wanted.

Thanks to everyone who responded, especially on a Sunday.