Package org.exist.util.serializer

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


                final String next = i.next();
                serializer.characters(next.toCharArray(), 0, next.length());
                serializer.endElement("", "query", "query");
            }
            serializer.endElement("", "history", "history");
            serializer.endDocument();
            writer.close();
            SerializerPool.getInstance().returnObject(serializer);
        } catch (final IOException e) {
            System.err.println("IO error while writing query history.");
        } catch (final SAXException e) {
View Full Code Here


                handler.characters(value, 0, value.length);
              }
            }
            handler.endElement(Namespaces.EXIST_NS, "result", "exist:result");
            handler.endPrefixMapping("exist");
            handler.endDocument();
            SerializerPool.getInstance().returnObject(handler);
          } finally {
            writer.close();
          }
        } finally {
View Full Code Here

            serializer.startDocument();
            for (SequenceIterator i = seq.iterate(); i.hasNext(); ) {
                Item next = i.nextItem();
                next.toSAX(broker, serializer, props);
            }
            serializer.endDocument();
            //TODO : check content
            System.out.println(out.toString());

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

            serializer.startDocument();
            for(SequenceIterator i = result.iterate(); i.hasNext(); ) {
                Item next = i.nextItem();
                next.toSAX(broker, serializer, props);
            }
            serializer.endDocument();
            System.out.println(out.toString());
        } finally {
            pool.release(broker);
        }
    }
View Full Code Here

            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

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

                sax.endDocument();
               
            } catch(final SAXException e) {
                throw new XPathException(this, "Cannot serialize file. A problem occurred while serializing the node set: " + e.getMessage(), e);
               
            } catch(final IOException e) {
View Full Code Here

                diff.diff2XML(sax);
              }

              sax.endElement(ELEMENT_VERSION);

              sax.endDocument();
              String editscript = writer.toString();

              if (removeLast) {
                if(lastRev instanceof BinaryDocument) {
                  vCollection.removeBinaryResource(transaction, broker, lastRev.getFileURI());
View Full Code Here

                diff.diff2XML(sax);
              }

              sax.endElement(ELEMENT_VERSION);

              sax.endDocument();
              String editscript = writer.toString();

              if (removeLast) {
                if(lastRev instanceof BinaryDocument) {
                  vCollection.removeBinaryResource(transaction, broker, lastRev.getFileURI());
View Full Code Here

                    handler.characters(value, 0, value.length);
                }
            }
            handler.endElement(Namespaces.EXIST_NS, "result", "exist:result");
            handler.endPrefixMapping("exist");
            handler.endDocument();
            SerializerPool.getInstance().returnObject(handler);
            return writer.toString();
        } finally {
            factory.getBrokerPool().release(broker);
        }
View Full Code Here

            final DocumentCallback docCb = new DocumentCallback( output, serializer, null, null, docs, true );
            broker.getResourcesFailsafe( docCb, directAccess );

            serializer.endElement( Namespaces.EXIST_NS, "collection", "collection" );
            serializer.endPrefixMapping( "" );
            serializer.endDocument();
            output.closeContents();
        }
        catch( final Exception e ) {
            e.printStackTrace();
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.