Package org.exist.util.serializer

Examples of org.exist.util.serializer.SAXSerializer.startDocument()


            int p = 0;
            if (queryHistory.size() > 20) {
                p = queryHistory.size() - 20;
            }
            final AttributesImpl attrs = new AttributesImpl();
            serializer.startDocument();
            serializer.startElement("", "history", "history", attrs);
            for(final ListIterator<String> i = queryHistory.listIterator(p); i.hasNext(); ) {
                serializer.startElement("", "query", "query", attrs);
                final String next = i.next();
                serializer.characters(next.toCharArray(), 0, next.length());
View Full Code Here


            //TODO : check cardinality
            StringWriter out = new StringWriter();
            Properties props = new Properties();
            props.setProperty(OutputKeys.INDENT, "yes");
            SAXSerializer serializer = new SAXSerializer(out, props);
            serializer.startDocument();
            for (SequenceIterator i = seq.iterate(); i.hasNext(); ) {
                Item next = i.nextItem();
                next.toSAX(broker, serializer, props);
            }
            serializer.endDocument();
View Full Code Here

            System.out.println("Found: " + result.getItemCount());
            StringWriter out = new StringWriter();
            Properties props = new Properties();
            props.setProperty(OutputKeys.INDENT, "yes");
            SAXSerializer serializer = new SAXSerializer(out, props);
            serializer.startDocument();
            for(SequenceIterator i = result.iterate(); i.hasNext(); ) {
                Item next = i.nextItem();
                next.toSAX(broker, serializer, props);
            }
            serializer.endDocument();
View Full Code Here

                    SAXSerializer.class);
            Properties outputProperties = new Properties();
            outputProperties.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
            outputProperties.setProperty(OutputKeys.INDENT, "no");
            sax.setOutput(writer, outputProperties);
            sax.startDocument();
            diff2XML(sax);
            sax.endDocument();
            return writer.toString();
        } catch (SAXException e) {
            throw new DiffException("error while serializing diff: " + e.getMessage(), e);
View Full Code Here

                final Serializer serializer = context.getBroker().getSerializer();
                serializer.reset();
                serializer.setProperties(outputProperties);
                serializer.setReceiver(sax);

                sax.startDocument();

                while(siNode.hasNext()) {
                    final NodeValue next = (NodeValue)siNode.nextItem();
                    serializer.toSAX(next)
                }
View Full Code Here

            Properties outputProperties = new Properties();
            outputProperties.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
            outputProperties.setProperty(OutputKeys.INDENT, "no");
            sax.setOutput(writer, outputProperties);

            sax.startDocument();
            sax.startElement(ELEMENT_VERSION, null);
            writeProperties(sax, getVersionProperties(revision, documentPath, activeSubject));

            if(event == REMOVE_DOCUMENT_EVENT) {
              sax.startElement(ELEMENT_REMOVED, null);
View Full Code Here

            Properties outputProperties = new Properties();
            outputProperties.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
            outputProperties.setProperty(OutputKeys.INDENT, "no");
            sax.setOutput(writer, outputProperties);

            sax.startDocument();
            sax.startElement(ELEMENT_VERSION, null);
            writeProperties(sax, getVersionProperties(revision, documentPath, activeSubject));

            if (remove) {
              sax.startElement(ELEMENT_REMOVED, null);
View Full Code Here

            final SAXSerializer handler = (SAXSerializer) SerializerPool.getInstance().borrowObject(SAXSerializer.class);
            final StringWriter writer = new StringWriter();
            handler.setOutput(writer, getProperties(parameters));
           
//      serialize results
            handler.startDocument();
            handler.startPrefixMapping("exist", Namespaces.EXIST_NS);
            final AttributesImpl attribs = new AttributesImpl();
            attribs.addAttribute(
                    "",
                    "hitCount",
View Full Code Here

          final Writer writer = new OutputStreamWriter(os, encoding);
          try {
            handler.setOutput(writer, getProperties(parameters));

            // serialize results
            handler.startDocument();
            handler.startPrefixMapping("exist", Namespaces.EXIST_NS);
            final AttributesImpl attribs = new AttributesImpl();
            attribs.addAttribute(
                "",
                "hitCount",
View Full Code Here

        // serializer writes to __contents__.xml
        final SAXSerializer serializer = (SAXSerializer)SerializerPool.getInstance().borrowObject( SAXSerializer.class );
        serializer.setOutput( contents, contentsOutputProps );

        serializer.startDocument();
        serializer.startPrefixMapping( "", Namespaces.EXIST_NS );

        // write <collection> element
        final CollectionImpl cur  = (CollectionImpl)current;
        final AttributesImpl attr = new AttributesImpl();
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.