Package org.apache.xindice.xml

Examples of org.apache.xindice.xml.SymbolTable


                    log.trace(localDebugHeader +
                              "Internal symbols=<" + TextWriter.toString(symConfig.getElement()) + ">");
                }

                try {
                    symbols = new SymbolTable(symConfig.getElement(), true);
                } catch (Exception e) {
                    if (log.isWarnEnabled()) {
                        log.warn(localDebugHeader + "Error building symbol table from internal symbols", e);
                    }
                }
View Full Code Here


        loaded = true;
        try {
            if (data != null) {
                DocumentImpl doc = (DocumentImpl) getOwnerDocument();
                SymbolTable st = doc.getSymbols();

                ByteArrayInput bis = new ByteArrayInput(data, pos, len);
                XMLCompressedInput in = new XMLCompressedInput(bis, st);

                in.readSignature(); // Skip The Signature
                in.readContentSize(); // Skip The Content Size

                symbolID = in.readShort();
                SymbolTable.SymbolInfo si = st.getSymbolInfo(symbolID);
                nodeName = si.getQName();
                nsURI = si.getNamespaceURI();

                loadChildren(st);
            }
View Full Code Here

    }

    public void testCompressedDocument() throws Exception {
        // Compress the document with its own symbol table
        Document document = DOMParser.toDocument(XML);
        SymbolTable symbols = new SymbolTable();
        byte[] data = DOMCompressor.compress(document, symbols);
        Document compressedDoc = new DocumentImpl(data, symbols, null);

        // Store it in the collection
        collection.insertDocument("document", compressedDoc);
View Full Code Here

        loaded = true;
        try {
            if (data != null) {
                DocumentImpl doc = (DocumentImpl) getOwnerDocument();
                SymbolTable st = doc.getSymbols();

                ByteArrayInput bis = new ByteArrayInput(data, pos, len);
                XMLCompressedInput xci = new XMLCompressedInput(bis, st);

                xci.readSignature(); // Skip The Signature
View Full Code Here

        this.pos = pos;
        this.len = len;
    }

    public SAXEventGenerator(SymbolTable symbols, Document doc) {
        this.symbols = symbols != null ? symbols : new SymbolTable();
        data = DOMCompressor.compress(doc, this.symbols);
        pos = 0;
        len = data.length;
    }
View Full Code Here

        loaded = true;
        try {
            if (data != null) {
                DocumentImpl doc = (DocumentImpl) getOwnerDocument();
                SymbolTable st = doc.getSymbols();

                ByteArrayInput bis = new ByteArrayInput(data, pos, len);
                XMLCompressedInput xci = new XMLCompressedInput(bis, st);

                byte signature = xci.readByte();
                byte entityType = (byte) (signature & 0x1F);
                switch (entityType) {

                    case Signatures.ENT_DEFINED:
                        nodeName = st.getName(xci.readShort());
                        break;

                    case Signatures.ENT_AMP:
                        nodeName = "&amp;";
                        break;
View Full Code Here

        }
       
        try {
            if (data != null) {
                DocumentImpl doc = (DocumentImpl) getOwnerDocument();
                SymbolTable st = doc.getSymbols();

                ByteArrayInput bis = new ByteArrayInput(data, pos, len);
                XMLCompressedInput xci = new XMLCompressedInput(bis, st);

                xci.readSignature(); // Skip The Signature
View Full Code Here

     *
     * @param buffer The Hashtable
     * @return The Document
     */
    public Document convertToDocument(Hashtable buffer) {
        SymbolTable s = getSymbols(buffer);
        return new DocumentImpl((byte[]) buffer.get("document"), s, null);
    }
View Full Code Here

        // lastMod = ((Long) buffer.get("timestamp")).longValue();

        Document doc = new DocumentImpl((byte[]) buffer.get("symbols"), hcSyms, null);

        if (syms == null) {
            syms = new SymbolTable();
        }

        synchronized (syms) {
            syms.streamFromXML(doc.getDocumentElement());
        }
View Full Code Here

     *
     * @param buffer The Hashtable
     * @return The Document
     */
    public Document convertToDocument(Hashtable buffer) {
        SymbolTable s = getSymbols(buffer);
        return new DocumentImpl((byte[]) buffer.get("document"), s, null);
    }
View Full Code Here

TOP

Related Classes of org.apache.xindice.xml.SymbolTable

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.