Examples of StructuredQName


Examples of client.net.sf.saxon.ce.om.StructuredQName

  public void setParameter(String namespaceURI, String localName, Object value) {

    String ns = (namespaceURI == null)? "" : namespaceURI;

    try {
      StructuredQName qn = new StructuredQName("", ns, localName);
      controller.setParameter(qn, getValue(value));
    } catch (Exception e) {
      Xslt20ProcessorImpl.handleException(e, "setParameter");
    }
  }
View Full Code Here

Examples of client.net.sf.saxon.ce.om.StructuredQName

    public SourceLocator getSourceLocator() {
        return sourceLocator;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = new StructuredQName("err", NamespaceConstant.ERR, errorCode);
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.om.StructuredQName

     * @return a message that concatenates the message of this exception with its contained exceptions,
     *         also including information about the error code and location.
     */
    public static String getExpandedMessage(XPathException err) {

        StructuredQName qCode;
        String additionalLocationText;
        qCode = err.getErrorCodeQName();
        additionalLocationText = err.getAdditionalLocationText();
        if (qCode == null && err.getCause() instanceof XPathException) {
            qCode = ((XPathException)err.getCause()).getErrorCodeQName();
        }
        String message = "";
        String codeText = "";
        if (qCode != null) {
            if (qCode.getNamespaceURI().equals(NamespaceConstant.ERR)) {
                message = qCode.getLocalName();
            } else {
                message = qCode.getDisplayName();
            }
        }

        if (additionalLocationText != null) {
            message += " " + additionalLocationText;
View Full Code Here

Examples of client.net.sf.saxon.ce.om.StructuredQName

   
    private static String prevModule = "";

    public void enter(/*@NotNull*/ InstructionInfo info, XPathContext context) {
        int infotype = info.getConstructType();
        StructuredQName qName = info.getObjectName();
        String tag = tag(infotype);
        if (tag==null) {
            // this TraceListener ignores some events to reduce the volume of output
            return;
        }
        String file = StandardErrorListener.abbreviatePath(info.getSystemId());
        String msg = AbstractTraceListener.spaces(indent) + '<' + tag;
        String name = (String)info.getProperty("name");
        if (name!=null) {
            msg += " name=\"" + escape(name) + '"';
        } else if (qName != null) {
            msg += " name=\"" + escape(qName.getDisplayName()) + '"';
        }

        Iterator props = info.getProperties();
       
        while (props.hasNext()) {
View Full Code Here

Examples of client.net.sf.saxon.ce.om.StructuredQName

    * Evaluate the function at run-time
    */

    public Item evaluateItem(XPathContext context) throws XPathException {

        StructuredQName qName = propertyName;
        if (qName == null) {
            CharSequence name = argument[0].evaluateItem(context).getStringValueCS();
            try {
                qName = StructuredQName.fromLexicalQName(name,
                        false,
                        nsContext);
             } catch (XPathException err) {
                 dynamicError("Invalid system property name. " + err.getMessage(), "XTDE1390", context);
                 return null;
            }
        }
        return new StringValue(getProperty(
                qName.getNamespaceURI(), qName.getLocalName(), context.getConfiguration()));
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.om.StructuredQName

        if (requiredParams == null) {
            return;
        }
        Iterator<StructuredQName> iter = requiredParams.iterator();
        while (iter.hasNext()) {
            StructuredQName req = iter.next();
            if (params == null || !params.containsKey(req)) {
//           if (params == null || params.get(req) == null) {
                XPathException err = new XPathException("No value supplied for required parameter " +
                        req.getDisplayName());
                err.setErrorCode("XTDE0050");
                throw err;
            }
        }
    }
View Full Code Here

Examples of net.sf.saxon.om.StructuredQName

    public void error(Throwable exception) {
        log.error(exceptionMessage(exception) + exception.getMessage());
    }

    private String exceptionMessage(Throwable exception) {
        StructuredQName qCode = null;
        SourceLocator loc = null;
        String message = "";

        if (exception instanceof XPathException) {
            qCode = ((XPathException) exception).getErrorCodeQName();
        }

        if (exception instanceof TransformerException) {
            TransformerException tx = (TransformerException) exception;
            if (qCode == null && tx.getException() instanceof XPathException) {
                qCode = ((XPathException) tx.getException()).getErrorCodeQName();
            }

            if (tx.getLocator() != null) {
                loc = tx.getLocator();
                boolean done = false;
                while (!done && loc == null) {
                    if (tx.getException() instanceof TransformerException) {
                        tx = (TransformerException) tx.getException();
                        loc = tx.getLocator();
                    } else if (exception.getCause() instanceof TransformerException) {
                        tx = (TransformerException) exception.getCause();
                        loc = tx.getLocator();
                    } else {
                        done = true;
                    }
                }
            }
        }

        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())) {
                message = message + loc.getSystemId() + ":";
            }
            if (loc.getLineNumber() != -1) {
                message = message + loc.getLineNumber() + ":";
            }
            if (loc.getColumnNumber() != -1) {
                message = message + loc.getColumnNumber() + ":";
            }
        }

        if (qCode != null) {
            message = message + qCode.getDisplayName() + ":";
        }

        return message;
    }
View Full Code Here

Examples of net.sf.saxon.om.StructuredQName

        if (requiredParams == null) {
            return;
        }
        Iterator<StructuredQName> iter = requiredParams.iterator();
        while (iter.hasNext()) {
            StructuredQName req = iter.next();
            if (params == null || params.get(req) == null) {
                XPathException err = new XPathException("No value supplied for required parameter " +
                        req.getDisplayName());
                err.setErrorCode("XTDE0050");
                throw err;
            }
        }
    }
View Full Code Here

Examples of net.sf.saxon.om.StructuredQName

            }
            String uri = nsContext.getURIForPrefix(prefix, false);
            if (uri==null) {
              dynamicError("Namespace prefix " + prefix + " has not been declared", "XTSE0650", context);
          }
            StructuredQName qName = new StructuredQName("", uri, localName);
            Template target = controller.getExecutable().getNamedTemplate(qName);
            if (target==null) {
              dynamicError("Template " + qname + " has not been defined", "XTSE0650", context);
            }
            return target;
View Full Code Here

Examples of net.sf.saxon.om.StructuredQName

            return SequenceType.SINGLE_STRING;
        }

        @Override
        public StructuredQName getFunctionQName() {
            return new StructuredQName("efx", "http://test/saxon/ext", "simple");
        }
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.