Package com.xmlcalabash.util

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


            if (failureThreshold && (rc > failureThresholdValue)) {
                throw XProcException.stepError(64);
            }

            TreeWriter tree = new TreeWriter(runtime);
            tree.startDocument(step.getNode().getBaseURI());
            tree.addStartElement(c_result);
            tree.startContent();
            tree.addText("" + rc);
            tree.addEndElement();
            tree.endDocument();
View Full Code Here


    }

    public boolean processStartElement(XdmNode node) {
        // Use a TreeWriter to make the matching node into a proper document
        TreeWriter treeWriter = new TreeWriter(runtime);
        treeWriter.startDocument(node.getBaseURI());
        treeWriter.addSubtree(node);
        treeWriter.endDocument();

        current.resetWriter();
        current.write(treeWriter.getResult());
View Full Code Here

        return okResponse(msg, type, Status.SUCCESS_OK);
    }

    protected Representation okResponse(String msg, MediaType type, Status status) {
        TreeWriter tree = new TreeWriter(getGlobalRuntime());
        tree.startDocument(URI.create("http://example.com/"));
        tree.addStartElement(pr_response);
        tree.startContent();
        tree.addStartElement(pr_code);
        tree.startContent();
        tree.addText("" + status.getCode());
View Full Code Here

        } catch (Exception e) {
            throw new XProcException(e);
        }

        TreeWriter tree = new TreeWriter(runtime);
        tree.startDocument(step.getNode().getBaseURI());

        if ("svg".equals(format)) {
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray(), 0, baos.size());
            XdmNode svg = runtime.parse(new InputSource(bais));
            if (html) {
View Full Code Here

    public void run() throws SaxonApiException {
        super.run();

        TreeWriter tree = new TreeWriter(runtime);
        tree.startDocument(step.getNode().getBaseURI());
        tree.addStartElement(XProcConstants.c_result);

        tree.addAttribute(new QName("file-separator"), System.getProperty("file.separator"));
        tree.addAttribute(new QName("path-separator"), System.getProperty("path.separator"));
        tree.addAttribute(new QName("os-architecture"), System.getProperty("os.arch"));
View Full Code Here

    public void run() throws SaxonApiException {
        super.run();

        TreeWriter tree = new TreeWriter(runtime);
        tree.startDocument(step.getNode().getBaseURI());
        tree.addStartElement(XProcConstants.c_result);
        tree.startContent();

        tree.addStartElement(new QName("c", XProcConstants.NS_XPROC_STEP, "cwd"));
        tree.startContent();
View Full Code Here

    public void run() throws SaxonApiException {
        super.run();

        TreeWriter tree = new TreeWriter(runtime);
        tree.startDocument(step.getNode().getBaseURI());
        tree.addStartElement(XProcConstants.c_result);
        tree.startContent();

        Map<String,String> env = System.getenv();
        for (String key : env.keySet()) {
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.