Examples of XMLParseException


Examples of de.pdark.decentxml.XMLParseException

        token.setType(Type.ATTRIBUTE);

        parseName("attribute");

        if (pos == token.getStartOffset())
            throw new XMLParseException("Expected attribute name", source, pos);

        skipWhiteSpace();
        expect('=');
        skipWhiteSpace();

        char c = 0;
        if (pos < source.length())
            c = source.charAt(pos);
        if (c != '\'' && c != '"')
            throw new XMLParseException("Expected single or double quotes", source, pos);

        char endChar = c;
        boolean insideEntity = false;
        int errorPos = pos;

        while (true) {
            pos++;
            if (pos >= source.length()) {
                int i = Math.min(20, source.length() - token.getStartOffset());
                throw new XMLParseException("Missing end quote (" + endChar + ") of attribute: "
                    + lookAheadForErrorMessage(null, token.getStartOffset(), i), token);
            }

            c = source.charAt(pos);
            if (c == endChar)
                break;

            if (c == '<')
                throw new XMLParseException("Illegal character in attribute value: '" + c + "'", source, pos);

            if (c == '&') {
                insideEntity = true;
                errorPos = pos;
            } else if (c == ';') {
                verifyEntity(errorPos, pos + 1);
                insideEntity = false;
            } else {
                String msg = charValidator.isValid(source, pos);
                if (msg != null)
                    throw new XMLParseException("Illegal character found in attribute value. " + msg, source, pos);

                skipChar(c);
                pos--;
            }
        }

        if (insideEntity) {
            throw new XMLParseException("Missing ';' after '&': " + lookAheadForErrorMessage(null, errorPos, 20), source, errorPos);
        }

        // Skip end-char
        pos++;
    }
View Full Code Here

Examples of mf.org.apache.xerces.xni.parser.XMLParseException

                exception = (IOException) t;
            }
            else {
                StAXLocationWrapper slw = new StAXLocationWrapper();
                slw.setLocation(e.getLocation());
                throw new XMLParseException(slw, e.getMessage(), e);
            }
        }
        catch (IOException e) {
            exception = e;
        }
View Full Code Here

Examples of mf.org.apache.xerces.xni.parser.XMLParseException

            public int getLineNumber() { return fLineNumber; }
            public int getCharacterOffset() { return -1; }
            public String getEncoding() { return null; }
            public String getXMLVersion() { return null; }
        };
        return new XMLParseException(location, exception.getMessage(),exception);
    } // createXMLParseException(SAXParseException):XMLParseException
View Full Code Here

Examples of mf.org.apache.xerces.xni.parser.XMLParseException

                    }
                }
            }
            message = str.toString();
        }
        XMLParseException parseException = (exception != null) ?
            new XMLParseException(location, message, exception) :
            new XMLParseException(location, message);

        // get error handler
        XMLErrorHandler errorHandler = fErrorHandler;
        if (errorHandler == null) {
            if (fDefaultErrorHandler == null) {
View Full Code Here

Examples of name.pehl.totoe.xml.client.XmlParseException

            JavaScriptObject documentJso = parseImpl(xml, namespaces);
            return NodeFactory.create(documentJso);
        }
        catch (JavaScriptException e)
        {
            throw new XmlParseException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of net.sourceforge.nanoxml.XMLParseException

     * @throws XMLParseException if the xml element doesn't represent the given tag.
     */
    private void checkTag(XMLElement xml, String tag) {
        final String actualTag = xml.getName();
        if (!tag.equals(actualTag)) {
            throw new XMLParseException("", "tag is not '" + tag + "' (actual: '" + actualTag + "')");
        }       
    }
View Full Code Here

Examples of net.sourceforge.nanoxml.XMLParseException

                    sb.append(',');
                }
                sb.append(tags[i]);
            }
            sb.append(')');
            throw new XMLParseException("", "tag is not one of " + sb.toString() + " (actual: '" + actualTag + "')");
        }
       
        return indexTag;
    }
View Full Code Here

Examples of org.apache.xerces.xni.parser.XMLParseException

            public void setColumnNumber(int col) {}
            public int getLineNumber() { return fLineNumber; }
            public void setLineNumber(int line) {}
            public String getEncoding() { return null; }
        };
        return new XMLParseException(location, exception.getMessage(),
                                     exception.getException());
    } // createXMLParseException(SAXParseException):XMLParseException
View Full Code Here

Examples of org.apache.xerces.xni.parser.XMLParseException

            public int getColumnNumber() { return fColumnNumber; }
            public void setColumnNumber(int col) {}
            public int getLineNumber() { return fLineNumber; }
            public void setLineNumber(int line) {}
        };
        return new XMLParseException(location, exception.getMessage(),
                                     exception.getException());
    } // createXMLParseException(SAXParseException):XMLParseException
View Full Code Here

Examples of org.apache.xerces.xni.parser.XMLParseException

            public String getSystemId() { return fSystemId; }
            public String getBaseSystemId() { return null; }
            public int getColumnNumber() { return fColumnNumber; }
            public int getLineNumber() { return fLineNumber; }
        };
        return new XMLParseException(location, exception.getMessage(),
                                     exception.getException());
    } // createXMLParseException(SAXParseException):XMLParseException
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.