From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Stribblehill Subject: Re: suggestion: "native" orgmode XML export (and import?) Date: Fri, 7 Aug 2009 10:13:30 +0100 Message-ID: <1f38ae890908070213x1fabc9e3o75db945d9f86b2fa@mail.gmail.com> References: <4b11f87e0908060754o7601aeb1uf9b8cebf44c29a24@mail.gmail.com> <1f38ae890908061457m7350ecfdw566e7ce9adc6f06e@mail.gmail.com> <1f38ae890908061458kc3d71fci7f944ae03c2400e@mail.gmail.com> <4b11f87e0908062305ue685293m633213469c47d0e8@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZLW6-00033T-87 for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:13:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZLW0-00033H-Vr for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:13:37 -0400 Received: from [199.232.76.173] (port=49284 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZLW0-00033E-MT for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:13:32 -0400 Received: from mail-fx0-f205.google.com ([209.85.220.205]:62517) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MZLW0-0001Wu-3e for emacs-orgmode@gnu.org; Fri, 07 Aug 2009 05:13:32 -0400 Received: by fxm1 with SMTP id 1so1016615fxm.31 for ; Fri, 07 Aug 2009 02:13:30 -0700 (PDT) In-Reply-To: <4b11f87e0908062305ue685293m633213469c47d0e8@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ilya Shlyakhter Cc: emacs-orgmode [re-adding the mailing list] No, EXPERIMENTAL/org-export.el. Here's what I did after M-x load-file /path/to/org-export.el: (defun org-export-sexp (arg) (interactive "p") (let ((bufstr (org-export-parse arg))) (save-excursion (switch-to-buffer (get-buffer-create "*Org export*")) (erase-buffer) (insert (format "%s" bufstr))))) An org file such as: ---- Objectives * Q3 2009 :PROPERTIES: :SCORE: 0.77 :END: ** Operations *** [#0] Oncall. Keep the site up *** [#1] Keep the tubes clear. ** Projects ---- comes out as: ((:level 1 :heading Q3 2009 :properties ((SCORE . 0.77) (CATEGORY . proj-sanitised)) :content :subtree ((:level 2 :heading Operations :properties ((CATEGORY . proj-sanitised)) :content :subtree ((:level 3 :heading Oncall. Keep the site up :properties ((PRIORITY . 0) (CATEGORY . proj-sanitised)) :content :subtree nil) (:level 3 :heading Keep the tubes clear. :properties ((PRIORITY . 1) (CATEGORY . proj-sanitised)) :content :subtree nil))) (:level 2 :heading Projects :properties ((CATEGORY . proj-sanitised)) :content :subtree nil)))) 2009/8/7 Ilya Shlyakhter : > Thanks for the pointer. =A0 Did you mean org-exp.el? =A0 How exactly do I > get the internal representation? > thanks, > ilya > > On Thu, Aug 6, 2009 at 11:58 PM, Andrew Stribblehill wrot= e: >> I notice the experimental org-export.el contains an internal representat= ion. >> It would probably be very easy for your python to parse the lisp >> s-expression it uses, if it were exported. >> >> On Aug 6, 2009 3:55 PM, "Ilya Shlyakhter" wrote: >> >> I'm not an emacs-lisp programmer, but I'd like to write scripts >> (ideally in Python) to generate custom reports from my .org files. >> What would help a lot, is if there was a command to export an .org >> file to a "native" XML format that would mirror the org file's >> structure and all its logical elements (tags, properties, drawers, >> dates etc). =A0 I know about the DocBook exporter, but it maps orgmode's >> concepts onto DocBook concepts such as articles. =A0 I'm a longtime >> orgmode user and it would be much simpler to write a program in terms >> of the familiar org concepts (hierarchical entries, tags, properties >> etc). >> It would also be great if there was a way to import such an XML file >> back into org. =A0Then one could e.g. take Toodledo.com tasks and >> transform them into an orgmode file. >> >> There is an orgmode Python reader at >> http://www.members.optusnet.com.au/~charles57/GTD/orgnode.html >> and I plan to use that for now. =A0But it doesn't support all orgmode >> features, and more importantly it does its own parsing of orgfiles (so >> may not keep up with any future changes). =A0 Using orgmode's own >> parser, and then exporting the results as XML, would be much more >> reliable. >> >> ilya >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Remember: use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> >