Package org.apache.cocoon.xml

Examples of org.apache.cocoon.xml.ContentHandlerWrapper


            } else {
              XMLConsumer consumer;
              if (contentHandler instanceof XMLConsumer) {
                  consumer = (XMLConsumer)contentHandler;
              } else if (contentHandler instanceof LexicalHandler) {
                  consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
              } else {
                  consumer = new ContentHandlerWrapper(contentHandler);
              }
                // We have to add an environment changer
                // clean environment stack handling.
                EnvironmentStack envStack = CocoonComponentManager.getCurrentEnvironmentStack();
                int currentOffset = envStack.getOffset();
View Full Code Here


        try {
            XMLConsumer consumer;
            if (contentHandler instanceof XMLConsumer) {
                consumer = (XMLConsumer)contentHandler;
            } else if (contentHandler instanceof LexicalHandler) {
                consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
            } else {
                consumer = new ContentHandlerWrapper(contentHandler);
            }
            if (this.redirectSource != null) {
                SourceUtil.parse(this.manager, this.redirectSource, consumer);
            } else {
                // We have to buffer the result in order to get
View Full Code Here

        FileSavingEnvironment env =
            new FileSavingEnvironment(deparameterizedURI, lastModified, context,
                                      attributes, parameters, links,
                                      gatheredLinks, cliContext, null, log);

        XMLConsumer consumer = new ContentHandlerWrapper(handler);
        ProcessingPipeline pipeline = cocoon.buildPipeline(env);
        CocoonComponentManager.enterEnvironment(env, cocoon.getComponentManager(), cocoon);
        try {
            pipeline.prepareInternal(env);
            pipeline.process(env, consumer);
View Full Code Here

            } else {
              XMLConsumer consumer;
              if (contentHandler instanceof XMLConsumer) {
                  consumer = (XMLConsumer)contentHandler;
              } else if (contentHandler instanceof LexicalHandler) {
                  consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
              } else {
                  consumer = new ContentHandlerWrapper(contentHandler);
              }
                // We have to add an environment changer
                // for clean environment stack handling.
                CocoonComponentManager.enterEnvironment(this.environment,
                                                        this.manager,
View Full Code Here

                            TransformerHandler handler = xslt.getTransformerHandler(source);

                            final SAXResult result = new SAXResult(nextConsumer);
                            result.setLexicalHandler(nextConsumer);
                            handler.setResult(result);
                            nextConsumer = new ContentHandlerWrapper(handler, handler);
                            stylesheet = nextConsumer;
                        }
                        stylesheet.startDocument();
                    }
                    boolean includeFragment = true;
View Full Code Here

        try {
            XMLConsumer consumer;
            if (contentHandler instanceof XMLConsumer) {
                consumer = (XMLConsumer)contentHandler;
            } else if (contentHandler instanceof LexicalHandler) {
                consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
            } else {
                consumer = new ContentHandlerWrapper(contentHandler);
            }
            if (this.redirectSource != null) {
                this.redirectSource.toSAX(consumer);
            } else {
                ((XMLProducer)eventPipeline).setConsumer(consumer);
View Full Code Here

        try {
            XMLConsumer consumer;
            if (contentHandler instanceof XMLConsumer) {
                consumer = (XMLConsumer)contentHandler;
            } else if (contentHandler instanceof LexicalHandler) {
                consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
            } else {
                consumer = new ContentHandlerWrapper(contentHandler);
            }
            if (this.redirectSource != null) {
                this.redirectSource.toSAX(consumer);
            } else {
                try {
View Full Code Here

            } else {
              XMLConsumer consumer;
              if (contentHandler instanceof XMLConsumer) {
                  consumer = (XMLConsumer)contentHandler;
              } else if (contentHandler instanceof LexicalHandler) {
                  consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
              } else {
                  consumer = new ContentHandlerWrapper(contentHandler);
              }
                // We have to add an environment changer
                // for clean environment stack handling.
                CocoonComponentManager.enterEnvironment(this.environment,
                                                        this.manager,
View Full Code Here

                TextSerializer serializer = new TextSerializer();
                StringWriter writer = new StringWriter();
                serializer.setOutputCharStream(writer);

                ContentHandlerWrapper contentHandler = new ContentHandlerWrapper(serializer, serializer);
                contentHandler.startDocument();

                // TODO is root element necessary for TextSerializer?
                contentHandler.startElement(JXTemplateGenerator.NS, elementName, elementName, EMPTY_ATTRS);
                Invoker.execute(contentHandler, objectModel, executionContext, macroContext, namespaces, this.getNext(), this
                        .getEndInstruction());
                contentHandler.endElement(JXTemplateGenerator.NS, elementName, elementName);
                contentHandler.endDocument();
                valueStr = writer.toString();
            }
        } catch (Exception exc) {
            throw new SAXParseException(exc.getMessage(), getLocation(), exc);
        }
View Full Code Here

        try {
            XMLConsumer consumer;
            if (contentHandler instanceof XMLConsumer) {
                consumer = (XMLConsumer)contentHandler;
            } else if (contentHandler instanceof LexicalHandler) {
                consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
            } else {
                consumer = new ContentHandlerWrapper(contentHandler);
            }
            if (this.redirectSource != null) {
                SourceUtil.parse(this.manager, this.redirectSource, consumer);
            } else {
                // We have to buffer the result in order to get
View Full Code Here

TOP

Related Classes of org.apache.cocoon.xml.ContentHandlerWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.