Examples of StaticError


Examples of loop.StaticError

        List<Executable> executables = ModuleLoader.loadAndCompile(requireDecl.moduleChain);
        if (executables == null) {
          if (errors == null)
            errors = new ArrayList<AnnotatedError>();

          errors.add(new StaticError("Unable to locate module: " + requireDecl.moduleChain,
              requireDecl.sourceLine, requireDecl.sourceColumn));
        } else {
          for (Executable executable : executables) {
            if (executable.hasErrors()) {
              if (errors == null)
                errors = new ArrayList<AnnotatedError>();

              errors.addAll(executable.getStaticErrors());
            } else if (ModuleDecl.DEFAULT.name.equals(executable.getScope().getModuleName())) {
              if (errors == null)
                errors = new ArrayList<AnnotatedError>();

              errors.add(new StaticError("Imported file " + executable.file()
                  + ".loop is missing a 'module' declaration\n\nrequired in: " + file,
                  requireDecl.sourceLine, requireDecl.sourceColumn));
            } else {
              if (requireDecl.alias != null) {
View Full Code Here

Examples of net.sf.saxon.trans.StaticError

        try {
            String[] parts = checker.getQNameParts(qname);
            prefix = parts[0];
            localName = parts[1];
        } catch (QNameException err) {
            throw new StaticError("Invalid QName for variable: " + qname);
        }
        String uri = "";
        if (!("".equals(prefix))) {
            uri = getURIForPrefix(prefix);
        }
View Full Code Here

Examples of net.sf.saxon.trans.StaticError

        if (Namespaces.ODE_EXTENSION_NS.equals(ns)) prefix = "ode";
        if (prefix != null && prefix.length() > 0) prefix = prefix + ":";
        try {
            declareVariable(prefix + localName, null);
        } catch (XPathException e) {
            throw new StaticError(e);
        }
        return super.bindVariable(fingerprint);
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

    NamePool namePool = getTargetNamePool();
        String[] parts;
        try {
            parts = Name.getQNameParts(qname);
        } catch (QNameException err) {
            throw new StaticError(err.getMessage());
        }
    String prefix = parts[0];
        if ("".equals(prefix)) {
      return namePool.allocate(prefix, (short)0, qname);

        } else {

            String uri = getURIForPrefix(prefix, false);
            if (NamespaceConstant.isReserved(uri)) {
                StaticError err = new StaticError("Namespace prefix " + prefix + " refers to a reserved namespace");
                err.setErrorCode("XT0080");
                throw err;
            }
      return namePool.allocate(prefix, uri, parts[1]);
        }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

        }
    }

    protected void compileError(String message)
    throws TransformerConfigurationException {
        StaticError tce = new StaticError(message);
        tce.setLocator(this);
        compileError(tce);
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

     * @param errorCode the error code. May be null if not known or not defined
     * @throws TransformerConfigurationException
     */
    protected void compileError(String message, String errorCode)
    throws TransformerConfigurationException {
        StaticError tce = new StaticError(message);
        tce.setErrorCode(errorCode);
        tce.setLocator(this);
        compileError(tce);
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

    */

    public XSLVariableDeclaration bindVariable(int fingerprint) throws StaticError {
        XSLVariableDeclaration binding = getVariableBinding(fingerprint);
        if (binding==null) {
            throw new StaticError("Variable " + getTargetNamePool().getDisplayName(fingerprint) + " has not been declared");
        }
        return binding;
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

        if (name.equals("parent"))                  return PARENT;
        if (name.equals("preceding"))               return PRECEDING;
        if (name.equals("preceding-sibling"))       return PRECEDING_SIBLING;
        if (name.equals("self"))                    return SELF;
        // preceding-or-ancestor cannot be used in an XPath expression
        throw new StaticError("Unknown axis name: " + name);
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

            if ((i0 < 0 || i2 < i0) && (i8 < 0 || i2 < i8)) {   // found end of string
                addStringComponent(components, avt, last, i2);
                last = i2;
                break;
            } else if (i0 >= 0 && i0 != i1 && i8 < i0) {   // found a "{" with no matching "}"
                StaticError err = new StaticError(
                        "Unmatched opening curly brace in attribute value template \"" + avt.substring(0,i2) + "\"");
                err.setErrorCode("XT0350");
                throw err;
            } else if (i8 >= 0 && (i0 < 0 || i8 < i0)) {             // found a "}"
                if (i8 != i9) {                        // a "}" that isn't a "}}"
                    StaticError err = new StaticError(
                            "Closing curly brace in attribute value template \"" + avt.substring(0,i2) + "\" must be doubled");
                    err.setErrorCode("XT0360");
                    throw err;
                }
                addStringComponent(components, avt, last, i8 + 1);
                last = i8 + 2;
            } else if (i1 >= 0 && i1 == i0) {              // found a doubled "{{"
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

                        uri = env.getURIForPrefix(prefix);
                    }
                    int fingerprint = env.getNamePool().allocate(prefix, uri, parts[1]) & 0xfffff;
                    b = env.getFunctionLibrary().isAvailable(fingerprint, uri, parts[1], (int)arity);
                } catch (QNameException e) {
                    throw new StaticError(e.getMessage());
                }
                break;
        }
        return BooleanValue.get(b);
    }
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.