Package org.exist.util

Examples of org.exist.util.XMLString


     * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
     */
    @Override
    public void comment(final char[] ch, final int start, final int len) throws SAXException {
        try {
            receiver.comment(new XMLString(ch, start, len));
        } catch (final TransformerException e) {
            throw new SAXException(e.getMessage(), e);
        }
    }
View Full Code Here


    public void characters(final char[] ch, final int start, final int len) throws TransformerException {
        if(!declarationWritten) {
            writeDeclaration();
        }     
        final XMLString s = new XMLString(ch, start, len);
        characters(s);
        s.release();
    }
View Full Code Here

        }
    }
   
    @Override
    public void characters(final char[] ch, final int start, final int len) throws TransformerException {
        final XMLString s = new XMLString(ch, start, len);
        characters(s);
        s.release();
    }
View Full Code Here

    public void characters(char[] ch, int start, int length) throws SAXException {
        if (inCDATASection)
            {receiver.cdataSection(ch, start, length);}
        else
            {receiver.characters(new XMLString(ch, start, length));}
    }
View Full Code Here

     */
    //TODO : use an indexSpec member in order to get rid of <code>noTokenizing</code>
    public void storeText(CharacterDataImpl node, int indexingHint, FulltextIndexSpec indexSpec, boolean remove) {
        if (indexingHint == TOKENIZE || indexingHint == DO_NOT_TOKENIZE) {
            //TODO : case conversion should be handled by the tokenizer -pb
            final XMLString t = node.getXMLString().transformToLower();
            TextToken token;
            if (indexingHint == DO_NOT_TOKENIZE) {
                token = new TextToken(TextToken.ALPHA, t, 0, t.length());
                invertedIndex.addText(token, node.getNodeId(), remove);
            } else if (indexingHint == TOKENIZE){
                tokenizer.setText(t);
                while (null != (token = tokenizer.nextToken())) {
                    if (token.length() > MAX_TOKEN_LENGTH) {
View Full Code Here

    public void storeText(StoredNode parent, ElementContent text, int indexingHint, FulltextIndexSpec indexSpec, boolean remove) {
        //TODO : case conversion should be handled by the tokenizer -pb
        TextToken token;
        ElementContent.TextSpan span = text.getFirst();
        XMLString data = null;
        int currentOffset = 0;
        while (span != null) {
            if (data == null)
                {data = span.getContent().transformToLower();}
            else {
                currentOffset = data.length();
                data.append(span.getContent().transformToLower());
            }
            tokenizer.setText(data, currentOffset);
            while (null != (token = tokenizer.nextToken())) {
                if (token.length() > MAX_TOKEN_LENGTH) {
                    LOG.warn("Token length exceeded " + MAX_TOKEN_LENGTH + ": " + token.getText().substring(0,20) + "...");
View Full Code Here

        public Field(String name, boolean isAttribute, int wsTreatment, boolean caseSensitive) {
            this.name = name;
            this.attribute = isAttribute;
            this.wsTreatment = wsTreatment;
            this.content = new XMLString();
            this.caseSensitive = caseSensitive;
        }
View Full Code Here

        public StringIndexCallback() {
            count = 0;
        }
       
        public boolean indexInfo(Value value, long pointer) throws TerminatedException {
            @SuppressWarnings("unused")
      XMLString key = UTF8.decode(value.data(), value.start(), value.getLength());
//            System.out.println("\"" + key + "\": " + count);
            count++;
            return false;
        }
View Full Code Here

        if (length <= 0)
            {return;}
        if (charBuf != null) {
            charBuf.append(ch, start, length);
        } else {
            charBuf = new XMLString(ch, start, length);
        }
        if (currentEntityName != null)
            {currentEntityValue.append(ch, start, length);}
    }
View Full Code Here

        final ElementImpl last = stack.peek();
        if (last.getNodeName().equals(qname)) {
            if (charBuf != null && charBuf.length() > 0) {
                // remove whitespace if the node has just a single text child,
                // keep whitespace for mixed content.
                final XMLString normalized;
                if ((charBuf.isWhitespaceOnly() && suppressWSmixed) || last.preserveSpace()) {
                    normalized = charBuf;
                } else {
                    normalized = last.getChildCount() == 0 ?
                        charBuf.normalize(normalize) :
                            (charBuf.isWhitespaceOnly() ? null : charBuf);
                }
                if (normalized != null && normalized.length() > 0) {
                    text.setData(normalized);
                    text.setOwnerDocument(document);
                    last.appendChildInternal(prevNode, text);
                    if (!validate)
                        {storeText();}
                    setPrevious(text);
                }
                charBuf.reset();
            }
            stack.pop();
            XMLString elemContent = null;
            if (!validate && RangeIndexSpec.hasQNameOrValueIndex(last.getIndexType())) {
                elemContent = nodeContentStack.pop();
            }
            if (!validate) {
                final String content = elemContent == null ?
                        null : elemContent.toString();
                broker.endElement(last, currentPath, content);
                if (indexListener != null)
                    {indexListener.endElement(transaction, last, currentPath);}
            }
            currentPath.removeLastComponent();
View Full Code Here

TOP

Related Classes of org.exist.util.XMLString

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.