Re: Serving plain text

Posted by Colin O'Brien on
URL: https://discuss.orbeon.com/Serving-plain-text-tp26088p26090.html

Hi Eric

thanks for the quick response.

On Nov 17, 2005, at 3:25 PM, Eric van der Vlist wrote:

> I am not sure how you're describing that in your pipeline, but OPS
> pipelines are by definition XML and they always carry XML and only XML
> even to convey non XML documents :-)..
>
> Text documents are embedded in XML root elements such as:
>
> <document xsi:type="xs:string" content-type="text/plain;
> charset=iso-8859-1">
> This is line one of the input document!
> This is line two of the input document!
> This is line three of the input document!
> </document>
>
> http://www.orbeon.com/ops/doc/reference-formats#text-documents
>
That's interesting.
On a temporary basis, if nothing else, wrapping the text in an element
allows me to use debug to confirm what is coming out of my xslt, and
that it does not have the xml declaration at this point.

Of course, if I do nothing else, then the element is still there when
the text reaches the browser.

And the xml declaration has been added.

> The standard epilogue doesn't filter these documents and send them as
> XML...
>
> If you want to serve them as text, you need to either modify the
> epilogue of shortcut it bu using only a model in your page definition
> and use the HTTP serializer to send your document to the browser (see
> http://www.orbeon.com/ops/doc/processors-serializers-http#text-mode).

Well, of course, that's very interesting.
Like you, I am trying to avoid editing any files that come in the ops
distribution
(all my page flow is in a separate file - so far I have only edited
web.xml).
So I wouldn't want to edit the epilogue.

On the other hand, what I am doing is just an alternative view of the
data being generated.
Other times it wants to go as xml, or rss (which happily is in xml).
So I am deep in the V of the MVC when I make the decision that it needs
to be output as text and call the relevant transform.
So doing it in page flow would not only not be easy, I'm not sure it
conform to a key architectural concept ;-)

I will have to give this some more thought.

Thanks & regards
Colin




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws