XSP Processing ( Code Generation )
package org.apache.cocoon.www.docs.samples.xsp;
// A bunch of other imports …
public class counter_xsp extends XSPGenerator {
// .. Bookkeepig stuff commented out.
/* User Class Declarations */
static private int counter = 0;
private synchronized int count() {
public void generate() throws SAXException {
this.contentHandler.startDocument();
AttributesImpl xspAttr = new AttributesImpl();
this.contentHandler.startPrefixMapping("xsp", "http://apache.org/xsp");
this.contentHandler.startElement("", "page", "page", xspAttr);
// Statements to build the XML document ( Omitted )
this.contentHandler.endElement("", "page", "page");
this.contentHandler.endPrefixMapping("xsp");
this.contentHandler.endDocument();