Package com.xmlcalabash.core

Examples of com.xmlcalabash.core.XProcException


        iter = new AxisNodesIter(start, axis);
    }

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


                }
            } catch (SaxonApiException sae) {
                if (S9apiUtils.xpathSyntaxError(sae)) {
                    throw XProcException.dynamicError(23, element, sae.getCause().getMessage());
                } else {
                    throw new XProcException(sae);
                }
            }

            return use;
        }
View Full Code Here

            ByteArrayInputStream bais = new ByteArrayInputStream(decoded);
            InputSource is = new InputSource(bais);
            XdmNode doc = runtime.parse(is);
            result.write(doc);
        } catch (Exception e) {
            throw new XProcException(e);
        }
    }
View Full Code Here

                    throw new UnsupportedOperationException("Failed to load prettyprint.xsl stylesheet from resources.");
                }
                XdmNode ppd = runtime.parse(new InputSource(instream));
                prettyPrint = S9apiUtils.getDocumentElement(ppd);
            } catch (Exception e) {
                throw new XProcException(e);
            }
        }
    }
View Full Code Here

            store.deleteEntry(href.getString(), base);

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

                XdmItem item = iter.next();
                if (item instanceof XdmNode) {
                    XdmNode child = (XdmNode) item;
                    if (child.getNodeKind() == XdmNodeKind.ELEMENT) {
                        if (jchild != null) {
                            throw new XProcException("Found c:body containing more than one JSON element?");
                        } else {
                            jchild = child;
                        }
                    }
                }
            }
            json = jchild;
        }

        try {
            build(json, js, ROOT);
        } catch (JSONException jse) {
            throw new XProcException(jse);
        }

        return js.toString();
    }
View Full Code Here

                if (assertValid) {
                    throw XProcException.stepError(53);
                }
            }
        } catch (SAXException e) {
            throw new XProcException("SAX Exception", e);
        } catch (IOException e) {
            throw new XProcException("IO Exception", e);
        }

        result.write(srcdoc); // At the moment, we don't get any augmentation
    }
View Full Code Here

            ItemTypeFactory itf = new ItemTypeFactory(runtime.getProcessor());
            ItemType untypedAtomic = itf.getAtomicType(new QName(NamespaceConstant.SCHEMA, "xs:untypedAtomic"));
            XdmAtomicValue val = new XdmAtomicValue(value, untypedAtomic);
            return val;
        } catch (SaxonApiException sae) {
            throw new XProcException(sae);
        }
    }
View Full Code Here

        if ("true".equals(value) || "1".equals(value)) {
            return true;
        } else if ("false".equals(value) || "0".equals(value)) {
            return false;
        } else {
            throw new XProcException(node, "Non boolean string: " + value);
        }
    }
View Full Code Here

                }
            }
        }

        if (exception instanceof XProcException) {
            XProcException err = (XProcException) exception;
            loc = err.getLocator();
            if (err.getErrorCode() != null) {
                QName n = err.getErrorCode();
                qCode = new StructuredQName(n.getPrefix(),n.getNamespaceURI(),n.getLocalName());
            }
            if (err.getStep() != null) {
                message = message + err.getStep() + ":";
            }
        }

        if (loc != null) {
            if (loc.getSystemId() != null && !"".equals(loc.getSystemId())) {
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.