OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Partitioning?

[ Lists Home | Date Index | Thread Index ]

Didier PH Martin wrote:

> If I understand well the above scrip, if the browser is EI6 then the XML
> document is sent as is. However, the problem is still there. I need to
> get the inclusion of the style sheet PI at the very last moment since I
> not want to include a precise stylesheet but to let the system include
> the proper style sheet PI based on the calling user agent. Maybe I
> didn't understood the script but Cocoon is still not doing partitioning,
> at least in its current state.

Ah, now I understand what you're aiming at.

If you don't mind injecting the PI using a trivial XSLT transformation, 
this is possible with a slightly adapted sitemap:

        <map:match pattern="**.xml">
          <map:generate src="{1}.xml"/>
          <map:select type="browser">
            <map:when test="ie6">
              <map:transform src="injectpi.xsl">
                <map:parameter name="browser" value="ie6"/>
              <map:serialize type="xml"/>
            <map:when test="mozilla">
              <map:transform src="injectpi.xsl">
                <map:parameter name="browser" value="mozilla"/>
              <map:serialize type="xml"/>
              <map:transform src="foobar.xsl"/>
              <map:serialize type="html"/>

If you don't like doing this using XSLT and don't mind writing some Java 
code, creating your own custom Transformer that injects it directly into 
the SAX stream is trivial.

> Didier replies:
> Why would I say such a stupid thing Steven, my brain is not paralyzed
> with some mental illness or physical degradation :-) I just say that if
> you can install a transformation engine as a reverse proxy or as a
> proxy, then you simply have to add it on the front of your actual HTTP
> servers without modifications (with the exception of the DNS entry). The
> transformation server could even be a public service branching to your
> server. It could allow small content provider not able to install
> something like cocoon to be able to publish XML content and still enjoy
> the benefits of content adaptation to particular devices. Having a real
> partitioning of the pipeline processes is the next step in the evolution
> of servers.

Since Cocoon is able to treat XML resources stored on disk or retrieved 
across HTTP alike, this seems feasible to me. Maybe not without some 
coding, but hey, we shouldn't mind that :-)

Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@outerthought.org                      stevenn@apache.org


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS