Package net.sf.saxon.expr

Examples of net.sf.saxon.expr.RoleLocator



    public void validate() throws XPathException {
        select = typeCheck("select", select);
        try {
            RoleLocator role =
                new RoleLocator(RoleLocator.INSTRUCTION, "sql:column/select", 0);
            select = TypeChecker.staticTypeCheck(select,
                        SequenceType.SINGLE_ATOMIC,
                        false, role, makeExpressionVisitor());

        } catch (XPathException err) {
View Full Code Here


        } else {
            int slot = getSlotNumber();
            if (requiredType != null) {
                SuppliedParameterReference pref = new SuppliedParameterReference(slot);
                pref.setLocationId(staticContext.getLocationMap().allocateLocationId(getSystemId(), getLineNumber()));
                RoleLocator role = new RoleLocator(RoleLocator.PARAM, getVariableDisplayName(), 0);
                //role.setSourceLocator(new ExpressionLocation(this));
                role.setErrorCode("XTTE0590");
                conversion = TypeChecker.staticTypeCheck(
                        pref,
                        requiredType,
                        false,
                        role, makeExpressionVisitor());
View Full Code Here

        from = typeCheck("from", from);
        count = typeCheck("count", count);

        if (select != null) {
            try {
                RoleLocator role =
                    new RoleLocator(RoleLocator.INSTRUCTION, "xsl:number/select", 0);
                //role.setSourceLocator(new ExpressionLocation(this));
                role.setErrorCode("XTTE1000");
                select = TypeChecker.staticTypeCheck(select,
                                            SequenceType.SINGLE_NODE,
                                            false, role, makeExpressionVisitor());
            } catch (XPathException err) {
                compileError(err);
View Full Code Here

        from = typeCheck("from", from);
        count = typeCheck("count", count);

        if (select != null) {
            try {
                RoleLocator role =
                    new RoleLocator(RoleLocator.INSTRUCTION, "xsl:number/select", 0);
                select = TypeChecker.staticTypeCheck(select,
                                            SequenceType.SINGLE_NODE,
                                            false, role, getStaticContext());
            } catch (XPathException err) {
                compileError(err);
View Full Code Here

        } catch (XPathException e) {
            compileError(e);
        }
        try {
            if (requiredType != null) {
                RoleLocator role =
                        new RoleLocator(RoleLocator.TEMPLATE_RESULT, diagnosticId, 0);
                exp = TypeChecker.staticTypeCheck(exp, requiredType, false, role, getStaticContext());
            }
        } catch (XPathException err) {
            compileError(err);
        }
View Full Code Here

        select = typeCheck("select", select);

        if (groupBy != null) {
            groupBy = typeCheck("group-by", groupBy);
            try {
                RoleLocator role =
                    new RoleLocator(RoleLocator.INSTRUCTION, "xsl:for-each-group/group-by", 0);
                groupBy = TypeChecker.staticTypeCheck(groupBy,
                        SequenceType.ATOMIC_SEQUENCE,
                        false, role, getStaticContext());
            } catch (XPathException err) {
                compileError(err);
            }
        } else if (groupAdjacent != null) {
            groupAdjacent = typeCheck("group-adjacent", groupAdjacent);
            try {
                RoleLocator role =
                    new RoleLocator(RoleLocator.INSTRUCTION, "xsl:for-each-group/group-adjacent", 0);
                groupAdjacent = TypeChecker.staticTypeCheck(groupAdjacent,
                        SequenceType.SINGLE_ATOMIC,
                        false, role, getStaticContext());
            } catch (XPathException err) {
                compileError(err);
            }
        }

        starting = typeCheck("starting", starting);
        ending = typeCheck("ending", ending);

        if (starting != null || ending != null) {
            try {
                RoleLocator role =
                    new RoleLocator(RoleLocator.INSTRUCTION, "xsl:for-each-group/select", 0);
                select = TypeChecker.staticTypeCheck(select,
                                            SequenceType.NODE_SEQUENCE,
                                            false, role, getStaticContext());
            } catch (XPathException err) {
                compileError(err);
View Full Code Here

        select = typeCheck("select", select);
        regex = typeCheck("regex", regex);
        flags = typeCheck("flags", flags);

        try {
            RoleLocator role =
                new RoleLocator(RoleLocator.INSTRUCTION, "xsl:analyze-string/select", 0);
            select = TypeChecker.staticTypeCheck(select, SequenceType.SINGLE_STRING, false, role, getStaticContext());

            role =
                new RoleLocator(RoleLocator.INSTRUCTION, "xsl:analyze-string/regex", 0);
            regex = TypeChecker.staticTypeCheck(regex, SequenceType.SINGLE_STRING, false, role, getStaticContext());

            role =
                new RoleLocator(RoleLocator.INSTRUCTION, "xsl:analyze-string/flags", 0);
            flags = TypeChecker.staticTypeCheck(flags, SequenceType.SINGLE_STRING, false, role, getStaticContext());
        } catch (XPathException err) {
            compileError(err);
        }
View Full Code Here

            }
            comp = getCaseOrderComparer(base, caseOrderX);
        }

        if (dataTypeExpression==null || dataTypeExpression instanceof EmptySequence) {
            RoleLocator role =
                new RoleLocator(RoleLocator.INSTRUCTION, "xsl:sort/sort-key", 0);
            sortKey = new CardinalityChecker(sortKey, StaticProperty.ALLOWS_ZERO_OR_ONE, role);
            comp = new AtomicSortComparer(comp);
        } else {
            String dataType = ((StringValue)dataTypeExpression).getStringValue();
            if (dataType.equals("text")) {
View Full Code Here

     */

    protected void checkAgainstRequiredType(SequenceType required)
    throws TransformerConfigurationException {
        try {
            RoleLocator role = new RoleLocator(RoleLocator.VARIABLE, getVariableName(), 0);
            if (required!=null) {
                // check that the expression is consistent with the required type
                if (select != null) {
                    select = TypeChecker.staticTypeCheck(select, required, false, role, getStaticContext());
                } else {
View Full Code Here

                Block block = new Block();
                compileChildren(exec, block, true);
                select = block;
                try {
                    if (requiredType != null) {
                        RoleLocator role =
                                new RoleLocator(RoleLocator.VARIABLE, getVariableName(), 0);
                        select = TypeChecker.staticTypeCheck(select, requiredType, false, role, getStaticContext());
                    }
                } catch (XPathException err) {
                    err.setLocator(this);
                    compileError(err);
View Full Code Here

TOP

Related Classes of net.sf.saxon.expr.RoleLocator

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.