Posted by
Colin O'Brien on
URL: https://discuss.orbeon.com/Serving-plain-text-tp26088p26098.html
Yes, it was weird.
Even though my http-serializer was assigning a mime type (text/plain),
the document was still arriving as application/xml.
Since you had it working (many thanks for taking that effort) I knew
where to look next.
The comments in the epilogue say the instance is the xml submission.
That must mean an xforms submission, because in this case it is empty.
My "instance" was built from the url using default-submission in the
page flow.
Hence my test was failing, and I was following normal epilogue
processing.
If I ignore that detail and force the epilogue to execute my
http-serializer, then I do indeed send down a plain text file.
But to get that to work, it seems it wanted an xml document, so I am
still receiving my text wrapped in an xml element and the receiving
application won't want that.
Which is weird, because if I leave the element off and let the epilogue
do what it wants, it can process the text OK (apart from adding the xml
declaration).
I think that's enough for me for today ;-)
best regards
Colin
PS I am running this in Eclipse, so I am just going through epilogue.xpl
I don't think that makes any difference, but just to be complete.
On Nov 17, 2005, at 4:58 PM, Eric van der Vlist wrote:
> Le jeudi 17 novembre 2005 à 16:41 -0500, Colin O'Brien a écrit :
>> Hi Eric
>>
>> yes, I had already given in and started looking at the epilogue.
>> I was happy to see that it has the instance as input, since that is
>> where I know what view to use anyway.
>> So it is easy to just test and do my own http-serializer.
>>
>> Except that the browser still shows the output arriving with the xml
>> declaration.
>
> Weird...
>
> In 3.0, when I add the following "when" in the main p:choose:
>
> <!-- Non XML documents -->
> <p:when test="/document[@xsi:type]">
> <p:processor name="oxf:http-serializer">
> <p:input name="config">
> <config/>
> </p:input>
> <p:input name="data" href="#xformed-data"/>
> </p:processor>
> </p:when>
>
> I get my document served as text as expected.
>
> It's not 100% safe, though since the "document" element belongs to no
> namespace and there is a risk (at least in theory) that someone might
> use this element in a custom vocabulary with a different meaning in
> mind. That's why I have added a test that there is a xsi:type attribute
> to reduce this risk.
>
> I attach the pipeline that I have updated.
>
> Eric
--
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