From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: the "right way" to build OMPL export and import Date: Fri, 26 Apr 2013 15:23:43 -0700 Message-ID: <87haitorrk.fsf@ericabrahamsen.net> References: <87y5c5ou7h.fsf@ericabrahamsen.net> <87obd155dk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVqxT-0003cf-IV for emacs-orgmode@gnu.org; Fri, 26 Apr 2013 18:17:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVqxR-0004by-T1 for emacs-orgmode@gnu.org; Fri, 26 Apr 2013 18:17:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:42929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVqxR-0004bn-MX for emacs-orgmode@gnu.org; Fri, 26 Apr 2013 18:17:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UVqxQ-0002Hq-IQ for emacs-orgmode@gnu.org; Sat, 27 Apr 2013 00:17:32 +0200 Received: from 63.226.249.211 ([63.226.249.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Apr 2013 00:17:32 +0200 Received: from eric by 63.226.249.211 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Apr 2013 00:17:32 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Eric Abrahamsen writes: > >> I'm not sure the general export engine is going to be of much use, >> since XML is so completely flexible, but you'll definitely want to >> build it on top of the internal parser. > > It would be a bad idea not to use the export framework, unless you want > to reinvent the wheel (e.g., re-implementing skipping of :noexport: > tags). > >> Luckily, the parser turns an org subtree into a parse tree, and the >> function `xml-print' turns a parse tree into XML. They're not quite the >> same parse tree, but I guess you'll want to do something like this: >> >> >> #+BEGIN_SRC org >> ,* My Great Playlist >> ,** The Cold Cold Ground.mp3 >> :PROPERTIES: >> :OPML_TYPE: song >> :OPML_F: Tom Waits - The Cold Cold Ground >> :END: >> ,** Don't Eat the Yellow Snow.mp3 >> :PROPERTIES: >> :OPML_TYPE: song >> :OPML_F: Frank Zappa - Don't Eat the Yellow Snow >> :END: >> #+END_SRC >> >> >> | >> | >> org-element--parse-elements > > Please use `org-element-parse-buffer' instead. As the two consecutive > hyphens suggest, this is an internal function. I was hoping you'd jump in! Would you suggest an export backend that only handles headlines (other elements are a no-op)? I suppose you could just write org-opml-headline to read properties and return XML chunks, and then you wouldn't have to use `org-element-parse-buffer' at all. E