You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2004/08/04 22:14:17 UTC

Re: Read and Display Non-XML files

On Aug 4, 2004, at 3:59 PM, milkwaybridge wrote:

> I want to make a page which can diplay a file's content, this file can 
> be whatever format, like java, txt or etc.
>  but if I generate them with a file or html generator, all the 
> formatĀ is gone. the file becomes a huge string.
> Is there any kind of generator, reader or action can do this?
> Thank you for your information!!!

Never thought about this before, but here's what I'd try (maybe 
somebody else has a better suggestion...):

An XML doc like this, let's call it "page.jx"

	<content>
		<xi:include parse="text" href="$source" />
	</content>

Then in yer pipeline:

	.
	.
	.
	<map:generate type="jx" src="page.jx">
		<map:parameter name="source" value="(whatever)" />
	</map:generate>
	<map:transform type=xinclude" />
	<map:call resource="to-html" />	<!-- whatever -->

Lotsa luck,
~ml

Re: Read and Display Non-XML files

Posted by Christina <le...@hotmail.com>.
I tried this, but as sooon as  the file goes into this "xml-based" pipline, all returns and white spaces disapear, the file turns into a huge string...

  ----- Original Message ----- 
  From: Mark Lundquist 
  To: users@cocoon.apache.org 
  Sent: Wednesday, August 04, 2004 1:14 PM
  Subject: Re: Read and Display Non-XML files



  On Aug 4, 2004, at 3:59 PM, milkwaybridge wrote:


    I want to make a page which can diplay a file's content, this file can be whatever format, like java, txt or etc.
    but if I generate them with a file or html generator, all the format is gone. the file becomes a huge string.
    Is there any kind of generator, reader or action can do this?
    Thank you for your information!!!


  Never thought about this before, but here's what I'd try (maybe somebody else has a better suggestion...):

  An XML doc like this, let's call it "page.jx"

  <content>
  <xi:include parse="text" href="$source" />
  </content>

  Then in yer pipeline:

  .
  .
  .
  <map:generate type="jx" src="page.jx">
  <map:parameter name="source" value="(whatever)" />
  </map:generate>
  <map:transform type=xinclude" />
  <map:call resource="to-html" /> <!-- whatever -->

  Lotsa luck,
  ~ml