Package net.sf.saxon.type

Examples of net.sf.saxon.type.Facet


    private XPathException checkAgainstFacets(String lexicalValue) {
        Iterator iter = typeLabel.getFacets();
        StringValue normalizedValue = null;
        while (iter.hasNext()) {
            Facet f = (Facet)iter.next();
            if (f.getName().equals(Facet.PATTERN)) {
                if (normalizedValue == null) {
                    if (lexicalValue == null) {
                        normalizedValue = new StringValue(primitiveValue.getStringValue());
                    } else {
                        normalizedValue = new StringValue(typeLabel.applyWhitespaceNormalization(lexicalValue));
                    }
                }
                if (!f.testAtomicValue(normalizedValue)) {
                    return new DynamicError(
                            "Value " + Err.wrap(normalizedValue.toString(), Err.VALUE) + " violates the pattern facet " +
                            (f.getValue()==null ? "" : Err.wrap(f.getValue(), Err.VALUE) + " ") +
                            "of the type "
                            + typeLabel.getDescription());
                }
            } else {
                if (!f.testAtomicValue(primitiveValue)) {
                    return new DynamicError(
                            "Value " + Err.wrap(displayValue(), Err.VALUE) + " violates the " +
                            f.getName() + " facet " +
                            (f.getValue()==null ? "" : Err.wrap(f.getValue(), Err.VALUE) + " ") +
                            "of the type "
                            + typeLabel.getDescription());
                    }
            }
        }
View Full Code Here

TOP

Related Classes of net.sf.saxon.type.Facet

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.