Package org.apache.cocoon.xml

Examples of org.apache.cocoon.xml.XMLConsumer


    public void startParametersRecording()
    throws SAXException {
        if (this.getLogger().isDebugEnabled()) {
            this.getLogger().debug("BEGIN startParametersRecording");
        }
        XMLConsumer recorder = new ParametersRecorder();
        this.addRecorder(recorder);

        this.sendStartPrefixMapping();

        if (this.getLogger().isDebugEnabled()) {
View Full Code Here


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

            setContentHandler(originalContentHandler);
            setLexicalHandler(originalLexicalHandler);
            this.originalLexicalHandler = null;
            this.originalContentHandler = null;
        } else {
            XMLConsumer next = (XMLConsumer) recorderStack.peek();
            setContentHandler(next);
            setLexicalHandler(next);
        }

        return recorder;
View Full Code Here

            } else {

                compiler = (XMLSerializer)this.manager.lookup(XMLSerializer.ROLE);
                compiler.startDocument();

                XMLConsumer nextConsumer = compiler;
                NodeList transformations = XMLUtil.selectNodeList(sunletConf,
                                                        "transformation/stylesheet");
                Transformer xslT = null;
                ArrayList transformers = new ArrayList();
                ComponentSelector selector = null;
                Request request = ObjectModelHelper.getRequest(this.objectModel);

                try {
                    if (transformations != null && transformations.getLength() > 0) {
                        selector = (ComponentSelector) this.manager.lookup(Transformer.ROLE + "Selector");
                        nextConsumer = new IncludeXMLConsumer(nextConsumer);
                        for(int k = transformations.getLength()-1; k >=0; k--) {
                            xslT = (Transformer)selector.select("xslt");
                            transformers.add(xslT);
                            xslT.setup(resolver,
                                       objectModel,
                                       XMLUtil.getValueOfNode(transformations.item(k)),
                                       new Parameters());
                            xslT.setConsumer(nextConsumer);
                            nextConsumer = xslT;
                        }
                        nextConsumer.startDocument();
                    }
                    switch (resource.getResourceType()) {
                        case ResourceConnector.RESOURCE_TYPE_CLASS: {
                             Sunlet theSunlet;
                             try {
View Full Code Here

        IncludeXMLConsumer filter;
        // Test for url rewriting
        if (typeParameters != null
            && typeParameters.getParameter(URLRewriter.PARAMETER_MODE, null) != null) {
            XMLConsumer consumer = new URLRewriter(typeParameters,
                                                   builder,
                                                   builder);
            filter = new IncludeXMLConsumer(consumer, consumer);
        } else {
            filter = new IncludeXMLConsumer(builder, builder);
View Full Code Here

        long startTime = System.currentTimeMillis();
        // Test for url rewriting
        if (typeParameters != null
            && typeParameters.getParameter(URLRewriter.PARAMETER_MODE, null) != null) {
            XMLConsumer consumer = new URLRewriter(typeParameters,
                                                   contentHandler,
                                                   lexicalHandler);
            contentHandler = consumer;
            lexicalHandler = consumer;
        }
View Full Code Here

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

            this.setContentHandler(originalContentHandler);
            this.setLexicalHandler(originalLexicalHandler);
            this.originalLexicalHandler = null;
            this.originalContentHandler = null;
        } else {
            XMLConsumer next = (XMLConsumer)recorderStack.peek();
            this.setContentHandler(next);
            this.setLexicalHandler(next);
        }
        return recorder;
    }
View Full Code Here

    public void startTextRecording()
    throws SAXException {
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN startTextRecording");
        }
        XMLConsumer recorder = new TextRecorder();
        this.addRecorder(recorder);

        this.sendStartPrefixMapping();

        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here

    public void startParametersRecording()
    throws SAXException {
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN startParametersRecording");
        }
        XMLConsumer recorder = new ParametersRecorder();
        this.addRecorder(recorder);

        this.sendStartPrefixMapping();

        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here

TOP

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

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.