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 |
%COMMENT{type="table"}%
%META:FORM{name="WebForm"}%
%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">
</twiki:meta:topicinfo>
<h1>Hello World</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam...
</p>
<ul>
<li>one</li>
<li>two</li>
</ul>
<table>
<tr>
<td>A1</td>
<td>B1</td>
</tr>
<tr>
<td>A2</td>
<td>B2</td>
</tr>
</table>
<twiki:comment type="table">
</twiki:comment>
<twiki:meta:form name="WebForm">
</twiki:meta:form>
<twiki:meta:field name="TopicSummary" title="TopicSummary" value="Something to say">
</twiki:meta:field>
<twiki:meta:field name="RelatedTopics" title="RelatedTopics" value="ChartPlugin">
</twiki:meta:field>
|
--
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