org.apache.cocoon.transformation
Class ReadDOMSessionTransformer
java.lang.Object
org.apache.cocoon.util.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
org.apache.cocoon.transformation.AbstractTransformer
org.apache.cocoon.transformation.ReadDOMSessionTransformer
- All Implemented Interfaces:
- ContentHandler, LexicalHandler, Poolable, Recyclable, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.transformation.Transformer, XMLConsumer, org.apache.cocoon.xml.XMLConsumer, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer
- public class ReadDOMSessionTransformer
- extends org.apache.cocoon.transformation.AbstractTransformer
With this transformer, an object that is stored in the session, can be inserted
in the SAX stream at a given position, using usual <xsp:expr> rules.
Object can be DOM Node, XMLizable, or any other object supported by <xsp:expr>.
Usage in sitemap:
<map:transform type="read-session">
<map:parameter name="attribute-name" value="companyInfo"/>
<map:parameter name="trigger-element" value="company"/>
<map:parameter name="position" value="after"/>
</map:transform>
Where:
- attribute-name is the name of the object in the session
- trigger-element is the element that we need to insert the SAX events
- postion is the actual place where the stream will be inserted, ie before, after or in
the trigger-element
- Version:
- $Id: ReadDOMSessionTransformer.html 1304280 2012-03-23 11:18:01Z ilgrosso $
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
recycle, setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
setConsumer |
ATTRIBUTE_NAME
public static final String ATTRIBUTE_NAME
- See Also:
- Constant Field Values
TRIGGER_ELEMENT
public static final String TRIGGER_ELEMENT
- See Also:
- Constant Field Values
POSITION
public static final String POSITION
- See Also:
- Constant Field Values
ReadDOMSessionTransformer
public ReadDOMSessionTransformer()
setup
public void setup(org.apache.cocoon.environment.SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
throws org.apache.cocoon.ProcessingException,
SAXException,
IOException
- BEGIN SitemapComponent methods
- Throws:
org.apache.cocoon.ProcessingException
SAXException
IOException
startElement
public void startElement(String uri,
String name,
String raw,
Attributes attributes)
throws SAXException
- BEGIN SAX ContentHandler handlers
- Throws:
SAXException
endElement
public void endElement(String uri,
String name,
String raw)
throws SAXException
- Throws:
SAXException
Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.