Package org.apache.xerces.util

Examples of org.apache.xerces.util.XMLStringBuffer


        }
        // spaces
        if (!skipSeparator(true, !scanningInternalSubset())) {
            if(fNamespaces && fEntityScanner.peekChar() == ':') {
                fEntityScanner.scanChar();
                XMLStringBuffer colonName = new XMLStringBuffer(name);
                colonName.append(":");
                String str = fEntityScanner.scanName();
                if (str != null)
                    colonName.append(str);
                reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                if (!skipSeparator(true, !scanningInternalSubset())) {
                    reportFatalError("MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL",
                             new Object[]{name});
                }
            } else {
View Full Code Here


        // spaces
        if (!skipSeparator(true, !scanningInternalSubset())) {
            // check for invalid ":"
            if(fNamespaces && fEntityScanner.peekChar() == ':') {
                fEntityScanner.scanChar();
                XMLStringBuffer colonName = new XMLStringBuffer(name);
                colonName.append(":");
                colonName.append(fEntityScanner.scanName());
                reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                skipSeparator(true, !scanningInternalSubset());
            } else {
                reportFatalError("MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL",
                                new Object[]{name});
            }
View Full Code Here

                return;
            }
            else {
                if(fNamespaces && fEntityScanner.peekChar() == ':') {
                    fEntityScanner.scanChar();
                    XMLStringBuffer colonName = new XMLStringBuffer(target);
                    colonName.append(":");
                    String str = fEntityScanner.scanName();
                    if (str != null)
                        colonName.append(str);
                    reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                    fEntityScanner.skipSpaces();
                } else {
                    // if there is data there should be some space
                    reportFatalError("SpaceRequiredInPI", null);
                }
View Full Code Here

        return new Object[] { "UTF-8", new Boolean(false)};

    } // getEncodingName(byte[],int):Object[]

    public void parse() throws IOException {
        XMLStringBuffer buffer = new XMLStringBuffer();
        fReader = getReader(fSource);
        if (fReader.ready()) {
            // deal with byte order mark, see spec 4.3
            if (!fCheckBOM) {
                int bom = fReader.read();
                // only include the character if it isn't the byte-order mark
                if (bom != '\uFEFF') {
                    buffer.append((char)bom);
                }
            }

            // REVISIT: We might want to consider sending the character events in chunks
            //          instead of reading them all.  This would be a space hog for large
            //          text includes.
            while (fReader.ready()) {
                buffer.append((char)fReader.read());
            }
            if (fHandler != null) {
                fHandler.characters(
                    buffer,
                    fHandler.modifyAugmentations(null, true));
View Full Code Here

        // time and memory. We should be reading chunks and reporting chunks instead
        // of reading characters individually and reporting all the characters in
        // one callback. Also, currently we don't provide any locator information:
        // line number, column number, etc... so if we report an error it will appear
        // as if the invalid XML character was in the include parent. -- mrglavas
        XMLStringBuffer buffer = new XMLStringBuffer();
        fReader = getReader(fSource);
        int ch;
        while((ch = fReader.read()) != -1) {
            if (isValid(ch)) {
                buffer.append((char)ch);
            }
            else if (XMLChar.isHighSurrogate(ch)) {
              int ch2 = fReader.read();
              if (XMLChar.isLowSurrogate(ch2)) {

                    // convert surrogates to a supplemental character
                    int sup = XMLChar.supplemental((char)ch, (char)ch2);

                    // supplemental character must be a valid XML character
                    if (!isValid(sup)) {
                        fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                                   "InvalidCharInContent",
                                                   new Object[] { Integer.toString(sup, 16) },
                                                   XMLErrorReporter.SEVERITY_FATAL_ERROR);
                        continue;
                    }                
                    buffer.append((char) ch);
                    buffer.append((char) ch2);
                }
                else {
                    fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                               "InvalidCharInContent",
                                               new Object[] { Integer.toString(ch, 16) },
View Full Code Here

        }
        // spaces
        if (!skipSeparator(true, !scanningInternalSubset())) {
            if(fNamespaces && fEntityScanner.peekChar() == ':') {
                fEntityScanner.scanChar();
                XMLStringBuffer colonName = new XMLStringBuffer(name);
                colonName.append(":");
                String str = fEntityScanner.scanName();
                if (str != null)
                    colonName.append(str);
                reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                if (!skipSeparator(true, !scanningInternalSubset())) {
                    reportFatalError("MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL",
                             new Object[]{name});
                }
            } else {
View Full Code Here

        // spaces
        if (!skipSeparator(true, !scanningInternalSubset())) {
            // check for invalid ":"
            if(fNamespaces && fEntityScanner.peekChar() == ':') {
                fEntityScanner.scanChar();
                XMLStringBuffer colonName = new XMLStringBuffer(name);
                colonName.append(":");
                colonName.append(fEntityScanner.scanName());
                reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                skipSeparator(true, !scanningInternalSubset());
            } else {
                reportFatalError("MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL",
                                new Object[]{name});
            }
View Full Code Here

                return;
            }
            else {
                if(fNamespaces && fEntityScanner.peekChar() == ':') {
                    fEntityScanner.scanChar();
                    XMLStringBuffer colonName = new XMLStringBuffer(target);
                    colonName.append(":");
                    String str = fEntityScanner.scanName();
                    if (str != null)
                        colonName.append(str);
                    reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                    fEntityScanner.skipSpaces();
                } else {
                    // if there is data there should be some space
                    reportFatalError("SpaceRequiredInPI", null);
                }
View Full Code Here

        }
        // spaces
        if (!skipSeparator(true, !scanningInternalSubset())) {
            if(fNamespaces && fEntityScanner.peekChar() == ':') {
                fEntityScanner.scanChar();
                XMLStringBuffer colonName = new XMLStringBuffer(name);
                colonName.append(":");
                String str = fEntityScanner.scanName();
                if (str != null)
                    colonName.append(str);
                reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                if (!skipSeparator(true, !scanningInternalSubset())) {
                    reportFatalError("MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL",
                             new Object[]{name});
                }
            } else {
View Full Code Here

        // spaces
        if (!skipSeparator(true, !scanningInternalSubset())) {
            // check for invalid ":"
            if(fNamespaces && fEntityScanner.peekChar() == ':') {
                fEntityScanner.scanChar();
                XMLStringBuffer colonName = new XMLStringBuffer(name);
                colonName.append(":");
                colonName.append(fEntityScanner.scanName());
                reportFatalError("ColonNotLegalWithNS", new Object[] {colonName.toString()});
                skipSeparator(true, !scanningInternalSubset());
            } else {
                reportFatalError("MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL",
                                new Object[]{name});
            }
View Full Code Here

TOP

Related Classes of org.apache.xerces.util.XMLStringBuffer

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.