Examples of NamePool


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

     * Type-check the expression
     */

    public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException {

        NamePool namePool = visitor.getConfiguration().getNamePool();
        TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy();
        StaticContext env = visitor.getStaticContext();

        operand0 = visitor.typeCheck(operand0, contextItemType);
        if (Literal.isEmptySequence(operand0)) {
View Full Code Here

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

        ItemType supplied = operand.getItemType(th);
        int relation = th.relationship(requiredItemType, supplied);
        if (relation == TypeHierarchy.SAME_TYPE || relation == TypeHierarchy.SUBSUMES) {
            return operand;
        } else if (relation == TypeHierarchy.DISJOINT) {
            final NamePool namePool = visitor.getConfiguration().getNamePool();
            if (Cardinality.allowsZero(card)) {

                String message = role.composeErrorMessage(
                        requiredItemType, operand.getItemType(th), namePool);
                visitor.getStaticContext().issueWarning("The only value that can pass type-checking is an empty sequence. " +
View Full Code Here

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

            if (context == null) {
                // no name pool available
                message = "Supplied value of type " + Type.displayTypeName(item) +
                        " does not match the required type of " + role.getMessage();
            } else {
                final NamePool pool = context.getNamePool();
                final TypeHierarchy th = context.getConfiguration().getTypeHierarchy();
                message = role.composeErrorMessage(requiredItemType, Value.asValue(item).getItemType(th), pool);
            }
            String errorCode = role.getErrorCode();
            if ("XPDY0050".equals(errorCode)) {
View Full Code Here

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

                t1.equals(BuiltInAtomicType.ANY_ATOMIC) || t1.equals(BuiltInAtomicType.UNTYPED_ATOMIC)) {
            // then no static type checking is possible
        } else {

            if (!Type.isComparable(pt0, pt1, Token.isOrderedOperator(singletonOperator))) {
                final NamePool namePool = visitor.getConfiguration().getNamePool();
                typeError("Cannot compare " +
                        t0.toString(namePool) + " to " + t1.toString(namePool), "XPTY0004", null);
            }
        }
View Full Code Here

Examples of com.icl.saxon.om.NamePool

                factory.newTransformer().transform(source, result);
                contextNode = (Node)result.getCurrentDocument();
            }

            DocumentInfo doc = ((NodeInfo)contextNode).getDocumentRoot();
            NamePool pool = doc.getNamePool();
            if (pool == null)
            {
                pool = NamePool.getDefaultNamePool();
                doc.setNamePool(pool);
            }
View Full Code Here

Examples of net.sf.saxon.om.NamePool

    // For background see net.sf.saxon.om.NamespaceIterator and
    // net.sf.saxon.om.NamespaceDeclarationsImpl
    int[] namespaces = node.getDeclaredNamespaces(NodeInfo.EMPTY_NAMESPACE_LIST);
    int i = 0;
    int nsCode;
    NamePool pool = null;
    while (i < namespaces.length && (nsCode = namespaces[i]) != -1) {
      short uriCode = (short) (nsCode & 0xffff);
      if (uriCode != 0) { // it is not an undeclaration
        if (pool == null) pool = node.getNamePool();
        String uri = pool.getURIFromURICode(uriCode);
        String prefix = pool.getPrefixFromNamespaceCode(nsCode);
       
        if (prefixes != null && prefixes.contains(prefix)) {
          if (DEBUG) System.err.println(
            "Safely ignoring additional namespace declaration for prefix="
            + prefix + ", uri=" + uri);
View Full Code Here

Examples of net.sf.saxon.om.NamePool

  private static Configuration createConfiguration() {
    Configuration config = new Configuration();
    config.setHostLanguage(Configuration.XQUERY);
    config.setErrorListener(new DefaultErrorListener());
    config.setAllowExternalFunctions(ALLOW_EXTERNAL_FUNCTIONS);
    if (!SHARE_NAMEPOOLS) config.setNamePool(new NamePool());
//    config.setAllNodesUntyped(true);
//    config.setLazyConstructionMode(true);
//    config.setModuleURIResolver(new DefaultModuleURIResolver());
   
    if (TRACE) {
View Full Code Here

Examples of net.sf.saxon.om.NamePool

            return this;
        }
        if (namespaceCodes == null || namespaceCodes.length == 0) {
            return this;
        }
        NamePool pool = visitor.getExecutable().getConfiguration().getNamePool();
        int uriCode = getURICode(pool);
        if (content instanceof FixedElement) {
            if (((FixedElement)content).getURICode(pool) == uriCode) {
                ((FixedElement)content).removeRedundantNamespaces(visitor, namespaceCodes);
            }
View Full Code Here

Examples of net.sf.saxon.om.NamePool

        int att = fat.getAttributeNameCode() & NamePool.FP_MASK;
        if (att == StandardNames.XSI_TYPE) {
            Expression attValue = fat.getSelect();
            if (attValue instanceof StringLiteral) {
                try {
                    NamePool pool = env.getNamePool();
                    String[] parts = env.getConfiguration().getNameChecker().getQNameParts(
                            ((StringLiteral)attValue).getStringValue());
                    // The only namespace bindings we can trust are those declared on this element
                    // We could also trust those on enclosing LREs in the same function/template,
                    // but it's not a big win to go looking for them.
                    int uriCode = -1;
                    for (int n=0; n<namespaceCodes.length; n++) {
                        String prefix = pool.getPrefixFromNamespaceCode(namespaceCodes[n]);
                        if (prefix.equals(parts[0])) {
                            uriCode = namespaceCodes[n] & 0xffff;
                            break;
                        }
                    }
                    if (uriCode == -1) {
                        return null;
                    }
                    String uri = pool.getURIFromURICode((short)uriCode);
                    int typefp = pool.allocate(parts[0], uri, parts[1]) & NamePool.FP_MASK;
                    return env.getConfiguration().getSchemaType(typefp);
                } catch (QNameException e) {
                    throw new XPathException(e.getMessage());
                }
            }
View Full Code Here

Examples of net.sf.saxon.om.NamePool

     *          if the module cannot be located, and if delegation to the default
     *          module resolver is not required.
     */

    public StreamSource[] resolve(String moduleURI, String baseURI, String[] locations) throws XPathException {
        NamePool pool = testCase.getNamePool();
        int moduleNC = pool.allocate("", "http://www.w3.org/2005/02/query-test-XQTSCatalog", "module");
        int namespaceNC = pool.allocate("", "", "namespace");
        AxisIterator iter = testCase.iterateAxis(Axis.CHILD, new NameTest(Type.ELEMENT, moduleNC, pool));
        List catalogLocations = new ArrayList(5);
        while (true) {
            NodeInfo m = (NodeInfo)iter.next();
            if (m == null) break;
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.