Package org.exist.memtree

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


           
            value = DynamicAttributeConstructor.normalize(this, qn, value);
           
            node = null;
            try {
                final int nodeNr = builder.addAttribute(qn, value);
                node = builder.getDocument().getAttribute(nodeNr);
            } catch (final DOMException e) {
                throw new XPathException(this, ErrorCodes.XQDY0025, "element has more than one attribute '" + qn + "'");
            }
        } finally {
View Full Code Here


            }
            if (value == null)
                value = "";
            node = null;
            try {
                int nodeNo = builder.addAttribute(qn, value);
                node = builder.getDocument().getAttribute(nodeNo);
            } catch (DOMException e) {
                throw new XPathException(this, ErrorCodes.XQDY0025, e.getMessage());
            }
        } finally {
View Full Code Here

        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);

        final NameValuePair[] headers = method.getResponseHeaders();
View Full Code Here

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

        builder.endElement();
View Full Code Here

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

        builder.endElement();
View Full Code Here

        final MemTreeBuilder builder = context.getDocumentBuilder();

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

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

        builder.addAttribute(new QName("type", null, null), "text");
        builder.addAttribute(new QName("encoding", null, null), "URLEncoded");
View Full Code Here

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

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

        builder.addAttribute(new QName("type", null, null), "text");
        builder.addAttribute(new QName("encoding", null, null), "URLEncoded");

        if(message != null) {
            builder.characters(URLEncoder.encode(message, "UTF-8"));
        }
View Full Code Here

        builder.addAttribute(new QName("statusCode", null, null), HTTP_EXCEPTION_STATUS_CODE);

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

        builder.addAttribute(new QName("type", null, null), "text");
        builder.addAttribute(new QName("encoding", null, null), "URLEncoded");

        if(message != null) {
            builder.characters(URLEncoder.encode(message, "UTF-8"));
        }
View Full Code Here

        Sequence xmlResponse = null;
        MemTreeBuilder builder = context.getDocumentBuilder();

        builder.startDocument();
        builder.startElement( new QName( "file", ZipModule.NAMESPACE_URI, ZipModule.PREFIX ), null );
        builder.addAttribute( new QName( "href", null, null ), uri.toString() );

        try {
            zis = zipFileSource.getStream();
            ZipEntry zipEntry;
            while ((zipEntry = zis.getNextEntry()) != null) {
View Full Code Here

            ZipEntry zipEntry;
            while ((zipEntry = zis.getNextEntry()) != null) {

                if (zipEntry.isDirectory()) {
                    builder.startElement(new QName("dir",ZipModule.NAMESPACE_URI,ZipModule.PREFIX),null);
                    builder.addAttribute(new QName("name",null,null), zipEntry.toString());
                    builder.endElement();
                } else {
                    logger.debug("file: " + zipEntry.getName());
                    builder.startElement(new QName("entry",ZipModule.NAMESPACE_URI,ZipModule.PREFIX),null);
                    builder.addAttribute(new QName("name",null,null), zipEntry.toString());
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.