create new tag
, view all tags

Idea for an XmlExportPlugin

Getting data out of TWiki is already possible, for example with the WebRssBase feeds, or with a topic that has a FormattedSearch suitable for another web application. It is also useful to export TWiki topic content in XML format, say to sync it up with other TWikis and/or wikis. Also, TWiki topic content in XML format can further be massaged via XSLT.

Last but not least, TWiki listed at WikiMatrix could checkmark the "XML export" feature as implemented.

A simple solution is to write a XmlExportPlugin that presents the current topic content in XML format, for example with an ?xmlexport=xml URL parameter to the view script. The XML format could be TWiki markup converted into XHML with TWiki variables changed into XML markup, e.g. from %FOO{ param1="value 1" param2="value 2" }% into <foo param1="value 1" param2="value 2"> or <twiki:foo param1="value 1" param2="value 2">. It could also just convert the TWiki variables and leave the TWiki markup unchanged.

Example topic content:

%META:TOPICINFO{author="PeterThoeny" date="1137402538" format="1.0" version="1.4"}%
---+ Hello World
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam...
   * one
   * two

| A1 | B1 |
| A2 | B2 |

%META:FIELD{name="TopicSummary" title="TopicSummary" value="Something to say"}%
%META:FIELD{name="RelatedTopics" title="RelatedTopics" value="ChartPlugin"}%

Example XML output: (sans header)

<twiki:meta:topicinfo author="PeterThoeny" date="1137402538" format="1.0" version="1.4">
<h1>Hello World</h1>
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam...
<twiki:comment type="table">
<twiki:meta:form name="WebForm">
<twiki:meta:field name="TopicSummary" title="TopicSummary" value="Something to say">
<twiki:meta:field name="RelatedTopics" title="RelatedTopics" value="ChartPlugin">

-- PeterThoeny - 20 Jan 2006

Wouldn't a DITA conform output be even more usefull?!

-- FranzJosefSilli - 20 Jan 2006

That is a good point, the output could be transformed into several DTDs, such as DITA and DocBook. This tranformation could be done outside of this Plugin, or by the Plugin (with ?xmlexport=dita or ?xmlexport=docbook URL parameters.)

-- PeterThoeny - 21 Jan 2006

More points to think about

  • using multiple topics to create a single xml document
  • adding means to extract application specific information from a topic, i.e. only its formfields

-- MichaelDaum - 26 Jan 2006

I've been waiting for a TWiki solution to create XML with links to attachments. Could this be feasible?

-- ArthurClemens - 02 Feb 2006

Arthur, I am not sure I understand. Could you make an example?

-- PeterThoeny - 02 Feb 2006

Just realized that topic content can be exported with the XmlQueryPlugin.

-- PeterThoeny - 09 Feb 2006

It seems like the XmlQueryPlugin does not include content outside of tables, actions, etc? How about the rest of a twiki topic?

-- PalWerdenhoff - 24 May 2006

Hi everyone! I saw on WikiMatrix that TWiki has XML export support, but have so far been unable to find out exactly how I would go about exporting topics from TWiki to an XML file, and what format they will be. Could anyone point me toward documentation about this?

-- TWikiGuest - 24 Mar 2007

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2007-03-24 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.