Code Java Exemples (XSPs)
package org.apache.cocoon.www.docs.samples.xsp;
import java.io.File;
// autres imports
public class counter_xsp extends XSPGenerator {
// .. Bookkeeping stuff commented out.
/* User Class Declarations */
static private int counter = 0;
private synchronized int count() {
return counter++;
}
/* Generate XML data. */
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();
}