emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "\"Martin G. Skjæveland\"" <martige@ifi.uio.no>
To: emacs-orgmode@gnu.org
Subject: org-babel-tangle xml text
Date: Tue, 03 Nov 2009 16:16:14 +0100	[thread overview]
Message-ID: <4AF0493E.3010602@ifi.uio.no> (raw)

Hi all,

I am quite new to the wonderful world of org-mode and org-babel. Right 
now I am using org-mode to make exercises for a semantic web programming 
course. org-mode and its friends give me a efficient writing tool, a 
presentation tool, export for web, export for print and a literate 
programming tool. That's nice!

But I have a question. I would like to include many code snippets 
written in RDF (XML/RDF, N3), which are languages not supported by 
org-babel [1], in my document, and I would like to use the "Edit the 
source code example at point in its native mode"-feature of org-mode and 
the tangle-feature of org-babel. Now I'm specifying the language as css 
(see below) since it is supported by org-babel and does not add any 
comments to output. This works for "tangling", but not for native editing.

Is there a way I can add xml and n3 to the list of supported languages? 
These languages does not need interpretation, so I'm thinking it should 
be quite easy to add. I have fumblingly tried

   (add-to-list 'org-babel-tangle-langs '("xml"))

and

   (add-to-list 'org-babel-tangle-langs '("css" "xml"))

but it as no effect.

Below is a sample of what I am currently using. Running org-babel-tangle 
gives me the correct foaf.rdf file. I would like to swap 'css' with 
'xml' so that the code can be edited and understood as xml.

#+SRCNAME: foaf-main
#+BEGIN_SRC css :tangle foaf.rdf
   <rdf:RDF>
     <<foaf-rel>>
   </rdf:RDF>
#+END_SRC

#+SRCNAME: foaf-rel
#+BEGIN_SRC css :tangle no
   <foaf:knows>
     <foaf:Person rdf:ID="timbl">
   </foaf:knows>
#+END_SRC


I hope this was clear -- and that someone can help.
Thanks!
Martin

  [1] 
http://orgmode.org/worg/org-contrib/babel/org-babel.php#reference-and-documentation

             reply	other threads:[~2009-11-03 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03 15:16 "Martin G. Skjæveland" [this message]
2009-11-03 16:18 ` org-babel-tangle xml text Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF0493E.3010602@ifi.uio.no \
    --to=martige@ifi.uio.no \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).