Package com.xmlcalabash.util

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


        tree.addEndElement();
        tree.addStartElement(BaseResource.pr_message);
        tree.startContent();
        tree.addText("Bad request: " + exceptionMessage(status.getThrowable()));
        tree.addEndElement();
        tree.addEndElement();
        tree.endDocument();
        return new StringRepresentation(tree.getResult().toString());
    }

    private String exceptionMessage(Throwable exception) {
View Full Code Here


                count = 0;
            }
        }

        if (count > 0) {
            tree.addEndElement();
            tree.endDocument();

            XdmNode out = tree.getResult();
            result.write(out);
        }
View Full Code Here

        treeWriter.addAttribute(_code, errorCode.toString());
        treeWriter.startContent();
        if (doc != null) {
            treeWriter.addSubtree(doc);
        }
        treeWriter.addEndElement();
        treeWriter.endDocument();

        step.reportError(treeWriter.getResult());

        if (doc == null) {
View Full Code Here

                data = data.replaceAll("^<.*?>",""); // Strip off the start tag...
                data = data.replaceAll("<[^<>]*?>$",""); // Strip off the end tag

                tree.addText(data);
                tree.addEndElement();
            }
        }
        tree.endDocument();

        result.write(tree.getResult());
View Full Code Here

                tree.addAttribute(_canonical_path, cp);
            } catch (Exception e) {
                // nevermind
            }
            tree.startContent();
            tree.addEndElement();
        } else {
            // Let's try HTTP
            HttpRequest httpReq = new HttpRequest(runtime, step);
            Pipe inputPipe = new Pipe(runtime);
            Pipe outputPipe = new Pipe(runtime);
View Full Code Here

                RuntimeValue v = getOption(name);
                if (v != null) { req.addAttribute(name, v.getString()); }
            }
           
            req.startContent();
            req.addEndElement();
            req.endDocument();

            inputPipe.write(req.getResult());

            httpReq.run();
View Full Code Here

                            line = brdr.readLine();
                            while (line != null && count < maxCount) {
                                tree.addStartElement(c_line);
                                tree.startContent();
                                tree.addText(line);
                                tree.addEndElement();
                                tree.addText("\n");
                                count++;
                                line = brdr.readLine();
                            }
                        } else {
View Full Code Here

                            line = brdr.readLine();
                            while (line != null) {
                                tree.addStartElement(c_line);
                                tree.startContent();
                                tree.addText(line);
                                tree.addEndElement();
                                tree.addText("\n");
                                line = brdr.readLine();
                            }
                        }
                    } finally {
View Full Code Here

            throw new XProcException(step.getNode(), "Cannot read: file does not exist: " + uri.toASCIIString());
        } catch (IOException ioe) {
            throw new XProcException(ioe);
        }

        tree.addEndElement();
        tree.endDocument();

        result.write(tree.getResult());
    }
}
View Full Code Here

                    tree.addStartElement(XProcConstants.c_result);
                    tree.startContent();

                    tree.addText(uri.toASCIIString());

                    tree.addEndElement();
                    tree.endDocument();

                    result.write(tree.getResult());
                }
            });
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.