OPML to Jot+ Notes conversion

Welcome Forums Jot+ Notes Jot+ Notes General OPML to Jot+ Notes conversion

This topic contains 0 replies, has 1 voice, and was last updated by  KingStairs 13 years, 8 months ago.

  • Author
    Posts
  • #654

    KingStairs
    Keymaster

    There have been a couple of requests for OPML support in Jot+ Notes, so I’ve knocked up a quick XSLT script for importing OPML to Jot-XML (see below)8).

    Unfortunately, OPML is not particularly well-specified :(: Applications are free to add arbitrary attributes, which means that different applications can (and do) generate wildly different files. In practice, this means that you may need to extend this script to support attributes added by your source application. The script comments should help.

    To use: Copy the script below to a file (eg opml2jot.xsl) and use it with your favorite XML tool (such as KsXML:wink:).

    If you do adapt this script to a specific OPML application, please consider posting the result here for the benefit of others; we can collect all the submissions together into an OPML zip file.

    As for a Jot-XML to OPML script, that’s left as an exercise for the reader… 😆

    We hope you find it useful.


    < ?xml version="1.0" encoding="iso-8859-1"?>

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:jot="urn:kingstairs-com:jot-3"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:user="urn:kingstairs-com:user"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    extension-element-prefixes="user"
    exclude-result-prefixes="user msxsl"
    version="1.0">



    < ![CDATA[
    function pad(v) {
    return (v<10?"0"+v:v);
    }
    function formatDate(dt) {
    return dt.getUTCFullYear() + "-" +
    pad(dt.getUTCMonth()+1) + "-" +
    pad(dt.getUTCDate()) + "T" +
    pad(dt.getUTCHours()) + ":" +
    pad(dt.getUTCMinutes()) + ":" +
    pad(dt.getUTCSeconds()) + "Z";
    }

    /* Converts RFC-822 format date-time to XML/XSD format */
    function convertDate(src) {
    var dt = new Date(Date.parse(src));
    return formatDate(dt);
    }
    ]]>













    Imported from OPML















    j0
    OPML










    j


























You must be logged in to reply to this topic.