Cocoon API: Class XIncludeProcessor

Class XIncludeProcessor

All Implemented Interfaces:
Actor, Cacheable, Changeable, Processor, Status

public class XIncludeProcessor
extends AbstractActor
implements Processor, Status, Cacheable

Second version of a DOM2 XInclude parser for cocoon. This revision should support the bulk of the 2000-07-17 version of the XInclude working draft. Notably excluded is inclusion loop checking (section 3.2.1). Note also that included namespaces may not be handled properly (section 3.2.2) - I'd love feedback on this. Namespaces are simple - but the DOM2 (and SAX2) methods for interacting with them aren't. Finally, note that the order of include element processing as noted in section 3.1 is not correct - internal xpointer links are not necessarily resolved against the original source document. I haven't figured out a good way to resolve that without cloning the entire source document first, which would be a terrible wasteful of memory.

CVS $Revision: 1.20 $ $Date: 2001/01/23 01:23:50 $ $Author: balld $
Donald Ball

Field Summary
static int BUFFER_SIZE
protected  java.lang.Object context
protected  boolean debug
protected  Logger logger
protected  Monitor monitor
protected  java.util.Hashtable monitored_table
protected  Parser parser
static java.lang.String XINCLUDE_HREF_ATTRIBUTE
static java.lang.String XINCLUDE_NAMESPACE_TAG
static java.lang.String XINCLUDE_NAMESPACE_URI
static java.lang.String XINCLUDE_PARSE_ATTRIBUTE
static java.lang.String XINCLUDE_TAG
static java.lang.String XMLBASE_ATTRIBUTE
static java.lang.String XMLBASE_NAMESPACE_URI
Fields inherited from class org.apache.cocoon.framework.AbstractActor
Constructor Summary
Method Summary
 java.lang.String getStatus()
          Returns information about the status of the implementing class.
 boolean hasChanged(java.lang.Object object)
          Returns false if the requested resource hasn't changed, true otherwise.
 void init(Director director)
          Initialize the actor by indicating their director.
 boolean isCacheable(javax.servlet.http.HttpServletRequest request)
          Returns whether this request is suitable for cacheing.
 org.w3c.dom.Document process(org.w3c.dom.Document document, java.util.Dictionary parameters)
          Process the DOM tree.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected boolean debug

public static final java.lang.String XMLBASE_NAMESPACE_URI

public static final java.lang.String XMLBASE_ATTRIBUTE


public static final java.lang.String XINCLUDE_NAMESPACE_TAG


public static final java.lang.String XINCLUDE_TAG


public static final java.lang.String XINCLUDE_NAMESPACE_URI


public static final java.lang.String XINCLUDE_HREF_ATTRIBUTE


public static final java.lang.String XINCLUDE_PARSE_ATTRIBUTE


public static final int BUFFER_SIZE


protected Parser parser


protected Logger logger


protected java.lang.Object context


protected Monitor monitor


protected java.util.Hashtable monitored_table
Constructor Detail


public XIncludeProcessor()
Method Detail


public void init(Director director)
Description copied from interface: Actor
Initialize the actor by indicating their director.
Specified by:
init in interface Actor
init in class AbstractActor


public org.w3c.dom.Document process(org.w3c.dom.Document document,
                                    java.util.Dictionary parameters)
                             throws java.lang.Exception
Description copied from interface: Processor
Process the DOM tree. The returned tree is allowed to be either a copy or the modified input tree.
Specified by:
process in interface Processor


public java.lang.String getStatus()
Description copied from interface: Status
Returns information about the status of the implementing class. Note: this is use instead of the usual toString() method because some of these methods are declared final in some classes in JDK 1.1.
Specified by:
getStatus in interface Status


public boolean hasChanged(java.lang.Object object)
Description copied from interface: Changeable
Returns false if the requested resource hasn't changed, true otherwise. This method is called by the cache system to ensure the validity of the cached response. It is the producer responsibility to provide the fastest possible implementation of this method or, whether this is not possible and the costs of the change evaluation is comparable to the production costs, to return true directly with no further delay, thus reducing the evaluation overhead to a minimum. This method is guaranteed to be called after at least a single call to any production methods getStream or getDocument. The context is the trigger of the changeable point and may differ between implementations.
Specified by:
hasChanged in interface Changeable


public boolean isCacheable(javax.servlet.http.HttpServletRequest request)
Description copied from interface: Cacheable
Returns whether this request is suitable for cacheing.
Specified by:
isCacheable in interface Cacheable

Copyright 1999-2001 Apache Software Foundation. All Rights Reserved.