Support
Help Save Reptile!
Navigation

Essentials

Installation

Developers

P2P (content distribution)

Search Infrastructure

Services

Proposals

Resources

XSLT

Reptile content generation is done via multiple pass XSLT transforms. This allows us to abstract certain operations into individual stylesheets.

Any complex operation is extended via the use of Xalan XSLT extensions. This allows us to tightly incorporate Java or other scripts with each leg of content generation.


XSLT rendering via sequences

All reptile content generation is done via a series of XSLT transformations known as sequences. These act as a stack of stylesheets with an input and output as XML. The input is usually read from a URL as a Java InputStream passed to Xalan.

The output is formed from the multiple transformations. This is collected and then passed to the requester.

All sequences are registered in 'resource:/xml/sequence-dispatch.xml'. This is parsed by Reptile when given a sequence that needs to be dispatched.


Sequence dispatching

Essentially everyhting is based around the StylesheetEngine interface.

Reptile provides a few implementations of this interface including the StreamStylesheetEngine.

The StylesheetEngine is responsible for dispatching all XSLT stylesheets in a SequenceDispatchEntry and providing the results to the caller.

The StylesheetStack provides a 'stack' of stylesheets which are processed by the StylesheetEngine as a FIFO queue.


Deploying sequences with sequence-dispatch.xml

All sequences are deployed in the file sequence-dispatch.xml which is available under Reptile as 'resource:/xml/sequence-dispatch.xml'.

Example:


    
<sequence-dispatch xmlns="http://schemas.openprivacy.org/reptile/sequence-dispatch">

    <!-- sequence for going over content which has a layout markup -->
    <sequence name="urn:abstract/layout">

        <stylesheet location="resource:/xsl/subscription/mozilla/controller.xsl"/>

        <stylesheet location="resource:/xsl/content/process.xsl"/>

        <stylesheet location="resource:/xsl/control/mozilla-control.xsl"/>

        <stylesheet location="resource:/xsl/misc/mozilla/page.xsl"/>

    </sequence>

    <!-- handle subscriptions   -->
    <sequence name="urn:subscriptions" parent="urn:abstract/layout">

        <skeleton location="resource:/xml/users/default/subscriptions.xml"/>

    </sequence>

</sequence-dispatch>
    

        

In the above example we have a sequence of 'urn:subscriptions' which has an input (or skeleton) of resource:/xml/users/default/subscriptions.xml. This sequence uses the 'urn:abstract/layout' sequence as a parent which it uses to obtain stylesheets.



Copyright © 2001-2003, OpenPrivacy.org