1 16 package org.apache.cocoon.portal.layout.renderer.aspect.impl; 17 18 import org.apache.cocoon.transformation.CIncludeTransformer; 19 import org.apache.cocoon.xml.AttributesImpl; 20 import org.xml.sax.ContentHandler ; 21 import org.xml.sax.SAXException ; 22 23 32 public abstract class AbstractCIncludeAspect 33 extends AbstractAspect { 34 35 protected static final String PREFIX = "cinclude"; 36 protected static final String NAMESPACE = CIncludeTransformer.CINCLUDE_NAMESPACE_URI; 37 protected static final String ELEMENT = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT; 38 protected static final String QELEMENT= PREFIX + ":" + ELEMENT; 39 protected static final String ATTRIBUTE = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE; 40 41 47 protected void createCInclude(String source, ContentHandler handler) 48 throws SAXException { 49 handler.startPrefixMapping(PREFIX, NAMESPACE); 50 AttributesImpl attributes = new AttributesImpl(); 51 attributes.addCDATAAttribute(ATTRIBUTE, source); 52 handler.startElement(NAMESPACE, ELEMENT, QELEMENT, attributes); 53 handler.endElement(NAMESPACE, ELEMENT, QELEMENT); 54 handler.endPrefixMapping(PREFIX); 55 } 56 57 } 58 | Popular Tags |