Package com.xmlcalabash.core

Examples of com.xmlcalabash.core.XProcException


                } else if ("transparent-json".equals(ext)) {
                    userArgs.setTransparentJSON(true);
                } else if (ext.startsWith("json-flavor=")) {
                    userArgs.setJsonFlavor(ext.substring(12));
                } else {
                    throw new XProcException("Unexpected extension: " + ext);
                }
                continue;
            }

            if (arg.startsWith("-")) {
                throw new XProcException("Unrecognized option: '" + arg + "'.");
            }

            if (arg.contains("=")) {
                KeyValuePair v = parseOption(arg);
                userArgs.addOption(v.key, v.value);
                arg = null;
                argpos++;
            } else {
                break;
            }
        }

        if (argpos < args.length) {
            userArgs.setPipeline(args[argpos++]);
        }

        while (argpos < args.length) {
            if (args[argpos].startsWith("-")) {
                throw new XProcException("Only options can occur on the command line after the pipeline document.");
            }
            KeyValuePair v = parseOption(args[argpos++]);
            userArgs.addOption(v.key, v.value);
        }
View Full Code Here


                } else if ("transparent-json".equals(ext)) {
                    userArgs.setTransparentJSON(true);
                } else if (ext.startsWith("json-flavor=")) {
                    userArgs.setJsonFlavor(ext.substring(12));
                } else {
                    throw new XProcException("Unexpected extension: " + ext);
                }
                continue;
            }

            if (arg.startsWith("-")) {
                throw new XProcException("Unrecognized option: '" + arg + "'.");
            }

            if (arg.contains("=")) {
                KeyValuePair v = parseOption(arg);
                userArgs.addOption(v.key, v.value);
                arg = null;
                argpos++;
            } else {
                break;
            }
        }

        if (argpos < args.length) {
            userArgs.setPipeline(args[argpos++]);
        }

        while (argpos < args.length) {
            if (args[argpos].startsWith("-")) {
                throw new XProcException("Only options can occur on the command line after the pipeline document.");
            }
            KeyValuePair v = parseOption(args[argpos++]);
            userArgs.addOption(v.key, v.value);
        }
View Full Code Here

                    result.write(tree.getResult());
                }
            });
        } catch (FileNotFoundException fnfe) {
            URI uri = href.getBaseURI().resolve(href.getString());
            throw new XProcException(href.getNode(), "Cannot read: file does not exist: " + uri.toASCIIString());
        } catch (IOException ioe) {
            throw new XProcException(ioe);
        }
    }
View Full Code Here

        if (arg.startsWith(lOpt + "=")) {
            arg = arg.substring(lOpt.length()+1);

            if (!arg.equals("true") && !arg.equals("false")) {
                throw new XProcException("Unparseable command line argument: " + lOpt + "=" + arg);
            }

            bool = arg.equals("true");
            arg = null;
            argpos++;
            return bool;
        }

        throw new XProcException("Unparseable command line argument: " + arg);
    }
View Full Code Here

            arg = null;
            argpos++;
            return value;
        }

        throw new XProcException("Unparseable command line argument: " + arg);
    }
View Full Code Here

        } else if (arg.equals(lOpt)) {
            opt = args[++argpos];
            arg = null;
            argpos++;
        } else {
            throw new XProcException("Unparseable command line argument: '" + arg + "'.");
        }

        return parseOption(opt);
    }
View Full Code Here

        int delpos = opt.indexOf(delimiter);
        if (delpos > 0) {
            key = opt.substring(0,delpos);
            value = opt.substring(delpos+1);
        } else {
            throw new XProcException("Unparseable command line argument: '" + opt + "'.");
        }

        return new KeyValuePair(key, value);
    }
View Full Code Here

        public InputStream getInputStream() throws IOException {
            return new ByteArrayInputStream(data);
        }

        public OutputStream getOutputStream() throws IOException {
            throw new XProcException("Called getOutputStream() on PartDataSource for cx:send-mail???");
        }
View Full Code Here

                for (String entry : getAllEntries(href.getString(), base)) {
                    store.deleteEntry(entry, entry);
                }
            } catch (FileNotFoundException e) {
                if (fail_on_error) {
                    throw new XProcException(step.getNode(), "Cannot delete: file does not exist", e);
                }
            } catch (IOException e) {
                if (fail_on_error) {
                    throw new XProcException(step.getNode(), e);
                }
            }
        }
        try {
            store.deleteEntry(href.getString(), base);
        } catch (FileNotFoundException e) {
            if (fail_on_error) {
                throw new XProcException(step.getNode(), "Cannot delete: file does not exist", e);
            }
        } catch (IOException e) {
            if (fail_on_error) {
                throw new XProcException(step.getNode(), e);
            }
        }
    }
View Full Code Here

        iter = new AxisNodesIter(start, axis);
    }

    public AxisNodes(XdmNode start, Axis axis, int filter) {
        if ((filter | VALID_BITS) != VALID_BITS) {
            throw new XProcException("Invalid filter passed to AxisNodes");
        }
        if ((filter & USE_WHEN) == USE_WHEN) {
            throw new XProcException("Pointless use of USE_WHEN filter in AxisNodes");
        }
        this.filter = filter;
        iter = new AxisNodesIter(start, axis);
    }
View Full Code Here

TOP

Related Classes of com.xmlcalabash.core.XProcException

Copyright © 2018 www.massapicom. 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.