Package org.apache.cocoon.xml.dom

Examples of org.apache.cocoon.xml.dom.DOMStreamer.stream()


        if (v != null) {
            DOMStreamer streamer = new DOMStreamer(contentHandler);
            if (contentHandler instanceof LexicalHandler) {
                streamer.setLexicalHandler((LexicalHandler)contentHandler);
            }
            streamer.stream(v);
        }
    }

    /**
     * Implementation of &lt;xsp:expr&gt; for <code>java.util.Collection</code> :
View Full Code Here


                       serializer = (Serializer)selector.select(serializerName);
                       oStream = ws.getOutputStream();
                       serializer.setOutputStream(oStream);
                         serializer.startDocument();
                       DOMStreamer streamer = new DOMStreamer(serializer);
                       streamer.stream(frag);
                         serializer.endDocument();
                  } catch (ComponentException e) {
                    throw new ProcessingException("Unable to lookup serializer.", e);
          } finally {
                      if (oStream != null) {
View Full Code Here

                        selector = (ComponentSelector)manager.lookup(Serializer.ROLE + "Selector");
                        serializer = (Serializer)selector.select(serializerName);
                        serializer.setOutputStream(oStream);
                        serializer.startDocument();
                        DOMStreamer streamer = new DOMStreamer(serializer);
                        streamer.stream(frag);
                        serializer.endDocument();
          } catch (ComponentException e) {
            throw new ProcessingException("Unable to lookup serializer.", e);
                    } finally {
                        if (oStream != null) {
View Full Code Here

                            Document document = parser.parseDocument(input);
                            NodeList list = processor.selectNodeList(document,xpath);
                            DOMStreamer streamer = new DOMStreamer(super.contentHandler,super.lexicalHandler);
                            int length = list.getLength();
                            for (int i=0; i<length; i++) {
                                streamer.stream(list.item(i));
                            }
                        } finally {
                            this.manager.release((Component)parser);
                        }
                    } else {
View Full Code Here

                            Object val =
                                getNode(expr, jexlContext, jxpathContext);
                            if (val instanceof Node) {
                                DOMStreamer streamer =
                                    new DOMStreamer(consumer);
                                streamer.stream((Node)val);
                                continue;
                            } else if (val instanceof NodeList) {
                                NodeList nodeList = (NodeList)val;
                                DOMStreamer streamer =
                                    new DOMStreamer(consumer);
View Full Code Here

                                DOMStreamer streamer =
                                    new DOMStreamer(consumer);
                                for (int i  = 0, len = nodeList.getLength();
                                     i < len; i++) {
                                    Node n = nodeList.item(i);
                                    streamer.stream(n);
                                }
                                continue;
                            }
                            if (val != null) {
                                chars = val.toString().toCharArray();
View Full Code Here

            builder.startElement(namespace, name, name, new AttributesImpl());

            DOMStreamer stream = new DOMStreamer(builder);

            for (int i = 0; i<values.getLength(); i++)
                stream.stream(values.item(i));

            builder.endElement(namespace, name, name);
            builder.endDocument();

            Document doc = builder.getDocument();
View Full Code Here

     * @param handler
     */
    public void toSAX(ContentHandler handler) throws SAXException {
        DOMStreamer stream = new DOMStreamer(handler);

        stream.stream(this.value);
    }
}
View Full Code Here

            throw new SAXException("Exception while converting object to DOM", e);
        }
       
        // Stream the document fragment
        DOMStreamer streamer = new DOMStreamer(handler);
        streamer.stream(df);
    }
}
View Full Code Here

    public void notify(Document doc) throws SAXException {
        // Call the user's transform method
        Document newdoc = transform(doc);
        // Now we stream the DOM tree out
        DOMStreamer s = new DOMStreamer(contentHandler, lexicalHandler);
        s.stream(newdoc);
    }

    /**
     * Transform the specified DOM, returning a new DOM to stream down the pipeline.
     * @param doc The DOM Document representing the SAX stream
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.