Package client.net.sf.saxon.ce.om

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


     * Get the name of the function for display in messages
     * @return  the name of the function as a lexical QName
     */

    public final String getDisplayName() {
        StructuredQName fName = getFunctionName();
        return (fName == null ? "(anonymous)" : fName.getDisplayName());
    }
View Full Code Here


            } catch (XPathException err) {
                compileError(err.getMessage(), err.getErrorCodeQName());
            }
        } else {
            try {
                StructuredQName formatName = makeQName(name);
                try {
                    dfm.setNamedDecimalFormat(formatName, d, decl.getPrecedence());
                } catch (XPathException err) {
                    compileError(err.getMessage(), err.getErrorCodeQName());
                }
View Full Code Here

        }             
    }

    private static String displayContainer(/*@NotNull*/ Container container) {
        if (container instanceof Procedure) {
            StructuredQName name = ((Procedure)container).getObjectName();
            String objectName = (name==null ? "" : name.getDisplayName());
            if (container instanceof Template) {
                if (name == null) {
                    //NamePool pool = container.getExecutable().getConfiguration().getNamePool();
                    return "template match=\"" + ((Template)container).getMatchPattern().toString() + "\"";
                } else {
                    return "template name=\"" + objectName + "\"";
                }
            } else if (container instanceof UserFunction) {
                return "function " + objectName + "()";
            } else if (container instanceof AttributeSet) {
                return "attribute-set " + objectName;
            } else if (container instanceof KeyDefinition) {
                return "key " + objectName;
            }
        } else if (container instanceof GlobalVariable) {
            StructuredQName qName = ((GlobalVariable)container).getVariableQName();
            if (NamespaceConstant.SAXON_GENERATED_GLOBAL.equals(qName.getNamespaceURI())) {
                return "optimizer-created global variable";
            } else {
                return "variable " + qName.getDisplayName();
            }
        } else {
            return "";
        }
        return "";
View Full Code Here

     * @param decl The declaration wrapping an XSLFunction object
     * @throws XPathException
     */
    protected void indexFunction(Declaration decl) throws XPathException {
        XSLFunction function = (XSLFunction)decl.getSourceElement();
        StructuredQName qName = function.getObjectName();
        int arity = function.getNumberOfArguments();

        // see if there is already a named function with this precedence
        Declaration other = getFunctionDeclaration(qName, arity);
        if (other == null) {
            // this is the first
            putFunction(decl);
        } else {
            // check the precedences
            int thisPrecedence = decl.getPrecedence();
            int otherPrecedence = other.getPrecedence();
            if (thisPrecedence == otherPrecedence) {
                StyleElement f2 = other.getSourceElement();
                if (decl.getSourceElement() == f2) {
                     function.compileError(
                             "Function " + qName.getDisplayName() + " is declared more than once " +
                             "(caused by including the containing module more than once)",
                             "XTSE0770");
                } else {
                    function.compileError("Duplicate function declaration (see line " +
                            f2.getLineNumber() + " of " + f2.getSystemId() + ')', "XTSE0770");
View Full Code Here

        }
    }

    protected void putFunction(Declaration decl) {
        XSLFunction function = (XSLFunction)decl.getSourceElement();
        StructuredQName qName = function.getObjectName();
        int arity = function.getNumberOfArguments();
        HashMap<StructuredQName, Declaration> m = functionIndex.get(arity);
        if (m == null) {
            m = new HashMap<StructuredQName, Declaration>();
            functionIndex.put(arity, m);
View Full Code Here

     * @throws XPathException
     */

    protected void indexVariableDeclaration(Declaration decl) throws XPathException {
        XSLVariableDeclaration var = (XSLVariableDeclaration)decl.getSourceElement();
        StructuredQName qName = var.getVariableQName();
        if (qName != null) {
            // see if there is already a global variable with this precedence
            Declaration other = globalVariableIndex.get(qName);
            if (other == null) {
                // this is the first
                globalVariableIndex.put(qName, decl);
            } else {
                // check the precedences
                int thisPrecedence = decl.getPrecedence();
                int otherPrecedence = other.getPrecedence();
                if (thisPrecedence == otherPrecedence) {
                    StyleElement v2 = other.getSourceElement();
                    if (v2 == var) {
                        var.compileError(
                                 "Global variable " + qName.getDisplayName() + " is declared more than once " +
                                 "(caused by including the containing module more than once)",
                                 "XTSE0630");
                    } else {
                        var.compileError("Duplicate global variable declaration (see line " +
                                v2.getLineNumber() + " of " + v2.getSystemId() + ')', "XTSE0630");
View Full Code Here

     * @param decl the declaration of the Template object
     * @throws XPathException
     */
    protected void indexNamedTemplate(Declaration decl) throws XPathException {
        XSLTemplate template = (XSLTemplate)decl.getSourceElement();
        StructuredQName qName = template.getTemplateName();
        if (qName != null) {
            // see if there is already a named template with this precedence
            Declaration other = templateIndex.get(qName);
            if (other == null) {
                // this is the first
View Full Code Here

    */

    private Expression promote(Expression parent, Expression child) {
        final TypeHierarchy th = optimizer.getConfiguration().getTypeHierarchy();
        LetExpression let = new LetExpression();
        let.setVariableQName(new StructuredQName("zz", NamespaceConstant.SAXON, "zz" + let.hashCode()));
        SequenceType type = SequenceType.makeSequenceType(child.getItemType(th), child.getCardinality());
        let.setRequiredType(type);
        ExpressionTool.copyLocationInfo(containingExpression, let);
        let.setSequence(child);
        let.setEvaluationMode(
View Full Code Here

   */
  public Object getParameter(String namespaceURI, String localName) {
    String ns = (namespaceURI == null)? "" : namespaceURI;
    try {
     
      StructuredQName qn = new StructuredQName("", ns, localName);
      ValueRepresentation vr = controller.getParameter(qn);
      return IXSLFunction.convertToJavaScript(vr);
    } catch(Exception e) {
      Xslt20ProcessorImpl.handleException(e, "getParameter");
    }
View Full Code Here

   */
  public void removeParameter(String namespaceURI, String localName) {
    String ns = (namespaceURI == null)? "" : namespaceURI;
    try {
     
      StructuredQName qn = new StructuredQName("", ns, localName);
            controller.removeParameter(qn);
    } catch(Exception e) {
      Xslt20ProcessorImpl.handleException(e, "getParameter");
    }
  }
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.om.StructuredQName

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.