Re: Serving plain text

Posted by Eric van der Vlist on
URL: https://discuss.orbeon.com/Serving-plain-text-tp26088p26094.html

Le lundi 21 novembre 2005 à 18:23 -0800, Alessandro Vernet a écrit :

> On 11/17/05, Eric van der Vlist <[hidden email]> wrote:
> > I'd even say that a modification that serialize non XML documents
> > according to the spec (http://www.orbeon.com/ops/doc/reference-formats)
> > would probably a good thing for most users and you might be able to
> > convince Erik and Alex to make it standard :-) ...
>
> Eric,
>
> So that would be a modification to the config/epilogue-servlet.xpl.
> Just like PDF is handled in that file right now, we would look for a
> root element <document xsi:type="xs:string" content-type="text/plain;
> charset=utf-8"> and use the text-converter in that case.
Yes. The patch I have proposed:

        <!-- 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>

is more general than just plain text and would also support binary
formats.

The only drawback I can see is the one mentioned in my previous mail :

> 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.

Eric
--
Le premier annuaire des apiculteurs 100% XML!
                                                http://apiculteurs.info/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
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