[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Partitioning?


cocoon custom transformer
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:transform>
              <map:serialize type="xml"/>
            </map:when>
            <map:when test="mozilla">
              <map:transform src="injectpi.xsl">
                <map:parameter name="browser" value="mozilla"/>
              </map:transform>
              <map:serialize type="xml"/>
            </map:when>
            <map:otherwise>
              <map:transform src="foobar.xsl"/>
              <map:serialize type="html"/>
            </map:otherwise>
          </map:select>
        </map:match>

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>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@o...                      stevenn@a...


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.