Package org.exist.util.serializer

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


            // 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 );
            final AttributesImpl attr = new AttributesImpl();
            attr.addAttribute( Namespaces.EXIST_NS, "name", "name", "CDATA", "/db/__lost_and_found__" );
            attr.addAttribute( Namespaces.EXIST_NS, "version", "version", "CDATA", String.valueOf( currVersion ) );
            attr.addAttribute( Namespaces.EXIST_NS, "owner", "owner", "CDATA", org.exist.security.SecurityManager.DBA_USER );
View Full Code Here


            final SAXSerializer serializer = (SAXSerializer)SerializerPool.getInstance().borrowObject( SAXSerializer.class );
            serializer.setOutput( contents, contentsOutputProps );

            final Permission perm = current.getPermissionsNoLock();
           
            serializer.startDocument();
            serializer.startPrefixMapping( "", Namespaces.EXIST_NS );
            final XmldbURI       uri  = current.getURI();
            final AttributesImpl attr = new AttributesImpl();
            attr.addAttribute( Namespaces.EXIST_NS, "name", "name", "CDATA", uri.toString() );
            attr.addAttribute( Namespaces.EXIST_NS, "version", "version", "CDATA", String.valueOf( currVersion ) );
View Full Code Here

            Serializer serializer = context.getBroker().getSerializer();
            serializer.reset();
            serializer.setProperties(params);
            serializer.setSAXHandlers(sax, sax);

            sax.startDocument();
           
            while(itSequence.hasNext()) {
               NodeValue next = (NodeValue)itSequence.nextItem();
               serializer.toSAX(next)
            }
View Full Code Here

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

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

                //database in read-only mode & there no configuration file,
                //create in memory document & configuration
                try {
                    final StringWriter writer = new StringWriter();
                    final SAXSerializer serializer = new SAXSerializer(writer, null);
                    serializer.startDocument();
                    serialize(instance, serializer);
                    serializer.endDocument();
                    final String data = writer.toString();
                    if (data == null || data.length() == 0) {
                        return null;
View Full Code Here

       
        final StringWriter writer = new StringWriter();
        final SAXSerializer serializer = new SAXSerializer(writer, null);
       
        try {
            serializer.startDocument();
            serialize(instance, serializer);
            serializer.endDocument();
           
        } catch (final SAXException saxe) {
            throw new ConfigurationException(saxe.getMessage(), saxe);
View Full Code Here

            serializer = (SAXSerializer) SerializerPool.getInstance().borrowObject(SAXSerializer.class);

            serializer.setOutput(writer, defaultProperties);
            final AttributesImpl attrs = new AttributesImpl();

            serializer.startDocument();
            serializer.startPrefixMapping("exist", Namespaces.EXIST_NS);
            serializer.startElement(Namespaces.EXIST_NS, "result",
                    "exist:result", attrs);

            attrs.addAttribute("", "name", "name", "CDATA", collection.getURI()
View Full Code Here

            serializer.reset();
            serializer.setProperties(outputProperties);
            serializer.setSAXHandlers(sax, sax);

           
            sax.startDocument();
            serializer.toSAX(node);
           
//            while(node.hasNext()) {
//                NodeValue next = (NodeValue)node.nextItem();
//                serializer.toSAX(next);
View Full Code Here

      serializer.setProperties(outputProperties);
      serializer.setUser(user);
      serializer.setSAXHandlers(handler, handler);

      //  serialize results
      handler.startDocument();
      handler.startPrefixMapping("exist", Namespaces.EXIST_NS);
      final AttributesImpl attribs = new AttributesImpl();
      attribs.addAttribute(
        "",
        "hitCount",
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.