|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.xml.AbstractXMLProducer | +--org.apache.cocoon.xml.AbstractXMLPipe | +--org.apache.cocoon.transformation.AbstractTransformer | +--org.apache.cocoon.transformation.XIncludeTransformer
My first pass at an XInclude transformation. Currently it should set the base URI from the SAX Locator's system id but allow it to be overridden by xml:base elements as the XInclude spec mandates. It's also got some untested code that should handle inclusion of text includes, but that method isn't called by the SAX event FSM yet.
Field Summary | |
protected Source |
base_xmlbase_uri
|
protected Source |
current_xmlbase_uri
The current XMLBase URI. |
protected java.lang.String |
last_xmlbase_element_name
name of the last element which had an xml:base attribute |
protected java.lang.String |
last_xmlbase_element_uri
namespace uri of the last element which had an xml:base attribute |
protected org.apache.avalon.framework.component.ComponentManager |
manager
|
static java.lang.String |
XINCLUDE_INCLUDE_ELEMENT
|
static java.lang.String |
XINCLUDE_INCLUDE_ELEMENT_HREF_ATTRIBUTE
|
static java.lang.String |
XINCLUDE_INCLUDE_ELEMENT_PARSE_ATTRIBUTE
|
static java.lang.String |
XINCLUDE_NAMESPACE_URI
|
static java.lang.String |
XMLBASE_ATTRIBUTE
|
protected java.util.Stack |
xmlbase_element_name_stack
|
protected java.util.Stack |
xmlbase_element_uri_stack
|
static java.lang.String |
XMLBASE_NAMESPACE_URI
|
protected java.util.Stack |
xmlbase_stack
This is a stack of xml:base attributes which belong to our ancestors |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
Constructor Summary | |
XIncludeTransformer()
|
Method Summary | |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
|
void |
dispose()
|
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String raw)
Receive notification of the end of an element. |
protected void |
endXMLBaseAttribute()
|
protected void |
processXIncludeElement(java.lang.String href,
java.lang.String parse)
|
void |
recycle()
Recycle the producer by removing references |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Receive an object for locating the origin of SAX document events. |
void |
setup(SourceResolver resolver,
java.util.Map objectModel,
java.lang.String source,
org.apache.avalon.framework.parameters.Parameters parameters)
Set the SourceResolver , objectModel Map ,
the source and sitemap Parameters used to process the request. |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String raw,
org.xml.sax.Attributes attr)
Receive notification of the beginning of an element. |
protected void |
startXMLBaseAttribute(java.lang.String uri,
java.lang.String name,
java.lang.String value)
|
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
setConsumer |
Field Detail |
protected org.apache.avalon.framework.component.ComponentManager manager
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_URI
public static final java.lang.String XINCLUDE_INCLUDE_ELEMENT
public static final java.lang.String XINCLUDE_INCLUDE_ELEMENT_HREF_ATTRIBUTE
public static final java.lang.String XINCLUDE_INCLUDE_ELEMENT_PARSE_ATTRIBUTE
protected Source base_xmlbase_uri
protected Source current_xmlbase_uri
protected java.util.Stack xmlbase_stack
protected java.lang.String last_xmlbase_element_uri
protected java.util.Stack xmlbase_element_uri_stack
protected java.lang.String last_xmlbase_element_name
protected java.util.Stack xmlbase_element_name_stack
Constructor Detail |
public XIncludeTransformer()
Method Detail |
public void setup(SourceResolver resolver, java.util.Map objectModel, java.lang.String source, org.apache.avalon.framework.parameters.Parameters parameters) throws ProcessingException, org.xml.sax.SAXException, java.io.IOException
SitemapModelComponent
SourceResolver
, objectModel Map
,
the source and sitemap Parameters
used to process the request.
setup
in interface SitemapModelComponent
ProcessingException
org.xml.sax.SAXException
java.io.IOException
public void compose(org.apache.avalon.framework.component.ComponentManager manager)
compose
in interface org.apache.avalon.framework.component.Composable
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String raw, org.xml.sax.Attributes attr) throws org.xml.sax.SAXException
AbstractXMLPipe
startElement
in interface org.xml.sax.ContentHandler
startElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.attr
- The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String raw) throws org.xml.sax.SAXException
AbstractXMLPipe
endElement
in interface org.xml.sax.ContentHandler
endElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.
org.xml.sax.SAXException
public void setDocumentLocator(org.xml.sax.Locator locator)
AbstractXMLPipe
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class AbstractXMLPipe
locator
- An object that can return the location of any SAX
document event.protected void startXMLBaseAttribute(java.lang.String uri, java.lang.String name, java.lang.String value) throws ProcessingException
ProcessingException
protected void endXMLBaseAttribute()
protected void processXIncludeElement(java.lang.String href, java.lang.String parse) throws org.xml.sax.SAXException, ProcessingException, java.io.IOException
org.xml.sax.SAXException
ProcessingException
java.io.IOException
public void recycle()
AbstractXMLProducer
recycle
in interface org.apache.avalon.excalibur.pool.Recyclable
recycle
in class AbstractXMLProducer
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |