Package net.sf.saxon

Examples of net.sf.saxon.Platform


            nonMatching = nonMatching.optimize(visitor, BuiltInAtomicType.STRING);
            adoptChildExpression(nonMatching);
        }
        if (pattern == null && regex instanceof StringLiteral && flags instanceof StringLiteral) {
            try {
                final Platform platform = Configuration.getPlatform();
                final CharSequence regex = ((StringLiteral)this.regex).getStringValue();
                final CharSequence flagstr = ((StringLiteral)flags).getStringValue();
                final int xmlVersion = visitor.getConfiguration().getXMLVersion();
                int flagBits = JRegularExpression.setFlags(flagstr);
                pattern = new JRegularExpression(regex, xmlVersion, RegularExpression.XPATH_SYNTAX, flagBits);
View Full Code Here


        CharSequence input = select.evaluateAsString(context);

        RegularExpression re = pattern;
        if (re == null) {
            CharSequence flagstr = flags.evaluateAsString(context);
            final Platform platform = Configuration.getPlatform();
            final int xmlVersion = context.getConfiguration().getXMLVersion();
            int flagBits = JRegularExpression.setFlags(flagstr);
            re = new JRegularExpression(regex.evaluateAsString(context), xmlVersion, RegularExpression.XPATH_SYNTAX, flagBits);  
            if (re.matches("")) {
                dynamicError("The regular expression must not be one that matches a zero-length string",
View Full Code Here

        if (kind != Type.ELEMENT && kind != Type.DOCUMENT) {
            dynamicError("Node in put() must be a document or element node",
                    "FOUP0001", context);
        }
        String relative = argument[1].evaluateItem(context).getStringValue();
        Platform platform = Configuration.getPlatform();
        String abs;
        try {
            URI resolved = ResolveURI.makeAbsolute(relative,  expressionBaseURI);
            abs = resolved.toString();
        } catch (URISyntaxException err) {
View Full Code Here

        }
        flags = makeAttributeValueTemplate(flagsAtt);

        if (regex instanceof StringLiteral && flags instanceof StringLiteral) {
            try {
                final Platform platform = Configuration.getPlatform();
                final CharSequence regex = ((StringLiteral)this.regex).getStringValue();
                final CharSequence flagstr = ((StringLiteral)flags).getStringValue();
                final int xmlVersion = getConfiguration().getXMLVersion();
                int flagBits = JRegularExpression.setFlags(flagstr);
                pattern = new JRegularExpression(regex, xmlVersion, RegularExpression.XPATH_SYNTAX, flagBits);
View Full Code Here

    }

    private void invalidRegex(String message, String errorCode) throws XPathException {
        compileError(message, errorCode);
        // prevent it being reported more than once
        final Platform platform = Configuration.getPlatform();
        final int xmlVersion = getConfiguration().getXMLVersion();
        int flagBits = JRegularExpression.setFlags("");
        pattern = new JRegularExpression("x", xmlVersion, RegularExpression.XPATH_SYNTAX, flagBits);
    }
View Full Code Here

                return new ComparisonKey(StandardNames.XS_NUMERIC, COLLATION_KEY_NaN);
            } else {
                return new ComparisonKey(StandardNames.XS_NUMERIC, a);
            }
        } else if (a instanceof StringValue) {
            final Platform platform = Configuration.getPlatform();
            if (platform.canReturnCollationKeys(collator)) {
                return new ComparisonKey(StandardNames.XS_STRING,
                        collator.getCollationKey(a.getStringValue()));
            } else {
                return new ComparisonKey(StandardNames.XS_STRING, a);
            }
View Full Code Here

    */

    public ComparisonKey getComparisonKey(AtomicValue a) {

        if (a instanceof StringValue) {
            Platform platform = Configuration.getPlatform();
            if (platform.canReturnCollationKeys(collator)) {
                return new ComparisonKey(StandardNames.XS_STRING,
                        collator.getCollationKey(a.getStringValue()));
            } else {
                return new ComparisonKey(StandardNames.XS_STRING, a.getStringValue());
            }
View Full Code Here

            flagstr = ((StringLiteral)args[flagsArg]).getStringValue();
        }

        if (args[patternArg] instanceof StringLiteral && flagstr != null) {
            try {
                Platform platform = Configuration.getPlatform();
                String in = ((StringLiteral)args[patternArg]).getStringValue();
                final int xmlVersion = env.getConfiguration().getXMLVersion();
                int syntax = RegularExpression.XPATH_SYNTAX;
                // TODO: Find a better (conformant) way of switching this option on
                if (flagstr.length() > 0 && flagstr.charAt(0) == '!') {
View Full Code Here

        }
        flags = makeAttributeValueTemplate(flagsAtt);

        if (regex instanceof StringLiteral && flags instanceof StringLiteral) {
            try {
                final Platform platform = Configuration.getPlatform();
                final CharSequence regex = ((StringLiteral)this.regex).getStringValue();
                final CharSequence flagstr = ((StringLiteral)flags).getStringValue();
                final int xmlVersion = getConfiguration().getXMLVersion();
                pattern = platform.compileRegularExpression(
                        regex, xmlVersion, RegularExpression.XPATH_SYNTAX, flagstr);

                if (pattern.matches("")) {
                    invalidRegex("The regular expression must not be one that matches a zero-length string", "XTDE1150");
                }
View Full Code Here

    */

    public ComparisonKey getComparisonKey(AtomicValue a) {

        if (a instanceof StringValue) {
            Platform platform = Configuration.getPlatform();
            if (platform.canReturnCollationKeys(collator)) {
                return new ComparisonKey(StandardNames.XS_STRING,
                        collator.getCollationKey(a.getStringValue()));
            } else {
                return new ComparisonKey(StandardNames.XS_STRING, a.getStringValue());
            }
View Full Code Here

TOP

Related Classes of net.sf.saxon.Platform

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.