Package com.xmlcalabash.util

Examples of com.xmlcalabash.util.TreeWriter.startDocument()


    if (!same && getOption(_fail_if_not_equal, false)) {
      throw XProcException.stepError(19);
    }

    TreeWriter treeWriter = new TreeWriter(runtime);
    treeWriter.startDocument(step.getNode().getBaseURI());
    treeWriter.addStartElement(c_result);
    treeWriter.startContent();
    treeWriter.addText(String.valueOf(same));
    treeWriter.addEndElement();
    treeWriter.endDocument();
View Full Code Here


        String cookieKey = getOption(_cookies).getString();

        TreeWriter tree = new TreeWriter(runtime);

        tree.startDocument(step.getNode().getBaseURI());
        tree.addStartElement(c_cookies);
        tree.startContent();

        for (Cookie cookie : runtime.getCookieStore(cookieKey).getCookies()) {
            tree.addStartElement(c_cookie);
View Full Code Here

        try {
            TreeWriter tree = new TreeWriter(runtime);

            if (name == null) {
                tree.startDocument(step.getNode().getBaseURI());
                tree.addStartElement(c_zipfile);
                tree.addAttribute(_href, systemId);
                tree.startContent();

                GregorianCalendar cal = new GregorianCalendar();
View Full Code Here

        if (!getPipelines().containsKey(id)) {
            return badRequest(Status.CLIENT_ERROR_NOT_FOUND, "no pipeline: " + pipelineUri(id), variant.getMediaType());
        }

        TreeWriter tree = new TreeWriter(getGlobalRuntime());
        tree.startDocument(URI.create("http://example.com/"));

        PipelineConfiguration pipeconfig = getPipelines().get(id);

        tree.addStartElement(pr_pipeline);
        tree.startContent();
View Full Code Here

                    // There's no point giving the file the URI of the pipeline document.
                    // This formulation is parallel to the jar scheme.
                    URI zipURI = URI.create("zip:" + zipFn + "!" + entry.getName());

                    tree.startDocument(zipURI);
                    tree.addStartElement(XProcConstants.c_data);
                    tree.addAttribute(_name,name);
                    tree.addAttribute(_content_type, contentType);
                    if (!storeText) {
                        tree.addAttribute(_encoding, "base64");
View Full Code Here

        try {
            xgroup.run();
        } catch (Exception xe) {
            TreeWriter treeWriter = new TreeWriter(runtime);
            treeWriter.startDocument(step.getNode().getBaseURI());
            treeWriter.addStartElement(c_errors);
            treeWriter.startContent();

            boolean reported = false;
            for (XdmNode doc : runtime.getXProcData().errors()) {
View Full Code Here

            URLConnection connection = url.openConnection();
            InputStream stream = connection.getInputStream();
            Metadata metadata = JpegMetadataReader.readMetadata(stream);

            TreeWriter tree = new TreeWriter(runtime);
            tree.startDocument(step.getNode().getBaseURI());
            tree.addStartElement(c_metadata);
            tree.addAttribute(_href, href.toASCIIString());
            tree.startContent();

            // iterate through metadata directories
View Full Code Here

            throw new XProcException(e);
        }

        if (href != null) {
            TreeWriter tree = new TreeWriter(runtime);
            tree.startDocument(step.getNode().getBaseURI());
            tree.addStartElement(XProcConstants.c_result);
            tree.startContent();
            tree.addText(href.toString());
            tree.addEndElement();
            tree.endDocument();
View Full Code Here

        final boolean showExcluded = "true".equals(step.getExtensionAttribute(px_show_excluded));

        final URI uri = URI.create("file:///").resolve(path);
        final TreeWriter tree = new TreeWriter(runtime);
        tree.startDocument(step.getNode().getBaseURI());
        tree.addStartElement(c_directory);
        tree.addAttribute(_name, getName(uri));
        tree.addAttribute(XProcConstants.xml_base, uri.toASCIIString());
        tree.startContent();
View Full Code Here

        }
    }

    public void returnData(ByteArrayOutputStream baos) {
        TreeWriter tree = new TreeWriter(runtime);
        tree.startDocument(step.getNode().getBaseURI());
        tree.addStartElement(XProcConstants.c_data);
        tree.addAttribute(_content_type, contentType);
        tree.startContent();
        tree.addText(baos.toString());
        tree.addEndElement();
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.