Supported content types for INCLUDE are text/html and text/plain.
It would be helpful to support text/xml also.
Even when I try to use a pattern to skip over the xml header, INCLUDE ignores the page.
It looks to me like a one line change to TWiki.pm should resolve this:
if( $contentType =~ /^text\/(html|xml)/ ) {
or
} elsif( $contentType =~ /^text\/(plain|css|xml)/ ) {
When I tried this in my personal TWIKi installation, I was able to INCLUDE an XML file. I had to use
TWiki:Plugins.BeautifierPlugin
to view the results, but that shouldn't stand in the way of permitting xml to be INCLUDEd.
Is there a technical reason why XML should not be INCLUDEable?
--
TWiki:Main/VickiBrown
- 27 Feb 2009
Hmmmm, a co-worker pointed out that XML could include its own
<head
,
<body
, or
<script
tags. We probably shouldn't just delete them completely. We also probably shouldn't just let them through.
Perhaps xml should have its own section with a variation on
sub _cleanupIncludedHTML
as
sub _cleanupIncludedXML
to Clean up XML text so that it can be shown embedded in a topic.
Co-worker has suggested a variation on verbatim to wrap everything in the XML body.. I think that would violate the Principle of Least Astonishment because INCLUDE never does that sort of thing. But I would be willing to be convinced.
My primary goal is to permit XML to be INCLUDEd. The How is implementation detail.
--
TWiki:Main.VickiBrown
- 02 Mar 2009
Sounds like a sensible enhancement. Best to create a feature proposal to refine the spec: If to format xml or not, what to strip.
--
TWiki:Main.PeterThoeny
- 03 Mar 2009