• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item6197: INCLUDE should accept XML

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal New   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


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)/ ) {
        } 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
 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

Summary INCLUDE should accept XML
ReportedBy TWiki:Main.VickiBrown
Codebase ~twiki4
SVN Range TWiki-5.0.0, Mon, 23 Feb 2009, build 17838
AppliesTo Engine

Priority Normal
CurrentState New


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r3 - 2009-03-03 - PeterThoeny
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback