Package org.exist.memtree

Examples of org.exist.memtree.MemTreeBuilder.startElement()


        context.pushDocumentContext();

        try {
            final MemTreeBuilder builder = context.getDocumentBuilder();
            final int            nodeNr  = builder.startElement( DIRECTORY_ELEMENT, null );

            if( dir.isDirectory() && dir.canRead() ) {
                final Pattern pattern = Pattern.compile( BackupDirectory.FILE_REGEX );
                final Matcher matcher = pattern.matcher( "" );
                final File[]  files   = dir.listFiles();
View Full Code Here


                            final Properties properties = descriptor.getProperties();

                            if( properties != null ) {
                                final AttributesImpl attrs = new AttributesImpl();
                                attrs.addAttribute( "", "file", "file", "CDATA", files[i].getName() );
                                builder.startElement( BACKUP_ELEMENT, attrs );

                                for( final Iterator<Object> iter = properties.keySet().iterator(); iter.hasNext(); ) {
                                    final String key = iter.next().toString();
                                    builder.startElement( new QName( key, Namespaces.EXIST_NS, "" ), null );
                                    builder.characters( (String)properties.get( key ) );
View Full Code Here

                                attrs.addAttribute( "", "file", "file", "CDATA", files[i].getName() );
                                builder.startElement( BACKUP_ELEMENT, attrs );

                                for( final Iterator<Object> iter = properties.keySet().iterator(); iter.hasNext(); ) {
                                    final String key = iter.next().toString();
                                    builder.startElement( new QName( key, Namespaces.EXIST_NS, "" ), null );
                                    builder.characters( (String)properties.get( key ) );
                                    builder.endElement();
                                }
                                builder.endElement();
                            }
View Full Code Here

            //Not in the specs but... makes sense
            if(!XMLChar.isValidName(qn.getLocalName()))
              {throw new XPathException(this, ErrorCodes.XPTY0004, "'" + qnitem.getStringValue() + "' is not a valid element name");}

            // add namespace declaration nodes
            final int nodeNr = builder.startElement(qn, attrs);
            if(namespaceDecls != null) {
                for(int i = 0; i < namespaceDecls.length; i++) {
                    builder.namespaceNode(namespaceDecls[i]);
                }
            }
View Full Code Here

   
    SVNWCClient wcClient = manager.getWCClient();

    MemTreeBuilder builder = context.getDocumentBuilder();
        builder.startDocument();
        builder.startElement(new QName("status", null, null), null);
   
        try {
      statusClient.doStatus(
          new Resource(uri),
          SVNRevision.HEAD,
View Full Code Here

          SVNDepth.getInfinityOrFilesDepth(true),
          true, true, false, false, 
          new AddStatusHandler(false, builder),
          null);
    } catch (SVNException e1) {
          builder.startElement(new QName("error", null, null), null);
          builder.characters(e1.getMessage());
          builder.endElement();
    }
   
        builder.endElement();
View Full Code Here

    private Sequence encodeResponseAsXML(final XQueryContext context, final HttpMethod method, final int statusCode, final Map<String, Boolean> parserFeatures, final Map<String, String> parserProperties) throws XPathException, IOException {

        final MemTreeBuilder builder = context.getDocumentBuilder();

        builder.startDocument();
        builder.startElement(new QName("response", NAMESPACE_URI, PREFIX), null );
        builder.addAttribute(new QName("statusCode", null, null), String.valueOf(statusCode));

        //Add all the response headers
        builder.startElement(new QName("headers", NAMESPACE_URI, PREFIX), null);
View Full Code Here

        builder.startDocument();
        builder.startElement(new QName("response", NAMESPACE_URI, PREFIX), null );
        builder.addAttribute(new QName("statusCode", null, null), String.valueOf(statusCode));

        //Add all the response headers
        builder.startElement(new QName("headers", NAMESPACE_URI, PREFIX), null);

        final NameValuePair[] headers = method.getResponseHeaders();

        for(final NameValuePair header : headers) {
            builder.startElement(new QName("header", NAMESPACE_URI, PREFIX), null);
View Full Code Here

        builder.startElement(new QName("headers", NAMESPACE_URI, PREFIX), null);

        final NameValuePair[] headers = method.getResponseHeaders();

        for(final NameValuePair header : headers) {
            builder.startElement(new QName("header", NAMESPACE_URI, PREFIX), null);
            builder.addAttribute(new QName("name", null, null), header.getName());
            builder.addAttribute(new QName("value", null, null), header.getValue());
            builder.endElement();
        }
View Full Code Here

        builder.endElement();

        if(!(method instanceof HeadMethod || method instanceof OptionsMethod)) { // Head and Options methods never have any response body

            // Add the response body node
            builder.startElement(new QName("body", NAMESPACE_URI, PREFIX), null);

            insertResponseBody(context, method, builder, parserFeatures, parserProperties);

            builder.endElement();
        }
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.