Package org.exist.dom

Examples of org.exist.dom.QName


    boolean haveCollapsedXhtmlPrefix = false;

    @Override
    public void startElement(final QName qname) throws TransformerException {
       
        final QName xhtmlQName = removeXhtmlPrefix(qname);
       
        super.startElement(xhtmlQName);
        currentTag = xhtmlQName.getStringValue();
    }
View Full Code Here


        currentTag = xhtmlQName.getStringValue();
    }
   
    @Override
    public void endElement(final QName qname) throws TransformerException {
        final QName xhtmlQName = removeXhtmlPrefix(qname);
       
        super.endElement(xhtmlQName);
       
        haveCollapsedXhtmlPrefix = false;
    }
View Full Code Here

    private QName removeXhtmlPrefix(final QName qname) {
        final String prefix = qname.getPrefix();
        final String namespaceURI = qname.getNamespaceURI();
        if(prefix != null && prefix.length() > 0 && namespaceURI != null && namespaceURI.equals(Namespaces.XHTML_NS)) {
            haveCollapsedXhtmlPrefix = true;
            return new QName(qname.getLocalName(), namespaceURI);  
        }
       
        return qname;
    }
View Full Code Here

        private final QName errorQName;
        private final String description;

        public ErrorCode(String code, String description) {
            this.errorQName = new QName(code, Namespaces.EXIST_XQUERY_XPATH_ERROR_NS, Namespaces.EXIST_XQUERY_XPATH_ERROR_PREFIX);
            this.description = description;
        }
View Full Code Here

    }

    public static class W3CErrorCode extends ErrorCode {

        private W3CErrorCode(String code, String description) {
            super(new QName(code, Namespaces.W3C_XQUERY_XPATH_ERROR_NS, Namespaces.W3C_XQUERY_XPATH_ERROR_PREFIX), description);
        }
View Full Code Here

    }

    public static class EXistErrorCode extends ErrorCode {

        private EXistErrorCode(String code, String description) {
            super(new QName(code, Namespaces.EXIST_XQUERY_XPATH_ERROR_NS, Namespaces.EXIST_XQUERY_XPATH_ERROR_PREFIX), description);
        }
View Full Code Here

    }

    public static class JavaErrorCode extends ErrorCode {

        public JavaErrorCode(Throwable throwable) {
            super(new QName(
                        throwable.getClass().getName(),
                        Namespaces.EXIST_XQUERY_XPATH_ERROR_NS,
                        "java" ), // Namespaces.EXIST_XQUERY_XPATH_ERROR_PREFIX
                  throwable.getMessage());
        }
View Full Code Here

                        + " not found");}
            final Occurrences occurrences[] = broker.getElementIndex().scanIndexedElements(collection,
                    inclusive);
            final IndexedElement[] result = new IndexedElement[occurrences.length];
            for (int i = 0; i < occurrences.length; i++) {
                final QName qname = (QName)occurrences[i].getTerm();
                result[i] = new IndexedElement(qname.getLocalName(),qname.getNamespaceURI(),
                        qname.getPrefix() == null ? "" : qname.getPrefix(),
                        occurrences[i].getOccurrences());
            }
            return new IndexedElements(result);
        } catch (final Exception ex) {
            throw new RemoteException(ex.getMessage());
View Full Code Here

              {throw new XPathException(this, ErrorCodes.XPTY0004, "item is not a node; got '" + Type.getTypeName(item.getType()) + "'");}
            //TODO : how to improve performance ?
            final Node n = ((NodeValue)item).getNode();
            //Returns an expanded-QName for node kinds that can have names.
            if (n instanceof QNameable) {
              final QName qn= ((QNameable)n).getQName();
              if (qn.equalsSimple(QName.EMPTY_QNAME))
                {result = Sequence.EMPTY_SEQUENCE;}
              else               
                {result = new QNameValue(context, qn);}
            //For other kinds of nodes it returns the empty sequence.
            } else
View Full Code Here

                if (uri == null && prefix != null && !"".equals(prefix)) {
                    throw new XPathException(this, ErrorCodes.FONS0004, "No namespace found for prefix. No binding for prefix '" + prefix
                                             + "' was found.", args[0]);
                }
                final String localPart = QName.extractLocalName(qnameString);
                final QName qn = new QName(localPart, uri);
                qn.setPrefix(prefix);
       
                final QNameValue result = new QNameValue(context, qn);
                if (context.getProfiler().isEnabled())
                    {context.getProfiler().end(this, "", result);}
               
View Full Code Here

TOP

Related Classes of org.exist.dom.QName

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.