Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamException


                               String localName,
                               String value)
        throws XMLStreamException
    {
        if (!isOpen())
            throw new XMLStreamException("A start element must be written before an attribute");
        prepareNamespace(namespaceURI);
        write(" ");
        writeName("",namespaceURI,localName);
        write("=\"");
        writeCharactersInternal(value.toCharArray(),0,value.length(),true);
View Full Code Here


                               String localName,
                               String value)
        throws XMLStreamException
    {
        if (!isOpen())
            throw new XMLStreamException("A start element must be written before an attribute");
        prepareNamespace(namespaceURI);
        context.bindNamespace(prefix,namespaceURI);
        write(" ");
        writeName(prefix,namespaceURI,localName);
        write("=\"");
View Full Code Here

   
    public void writeNamespace(String prefix, String namespaceURI)
        throws XMLStreamException
    {
        if(!isOpen())
            throw new XMLStreamException("A start element must be written before a namespace");
        if (prefix == null || "".equals(prefix) || "xmlns".equals(prefix)) {
            writeDefaultNamespace(namespaceURI);
            return;
        }
        if( needsWritingNs(prefix) ) {
View Full Code Here

   
    public void writeDefaultNamespace(String namespaceURI)
        throws XMLStreamException
    {
        if(!isOpen())
            throw new XMLStreamException("A start element must be written before the default namespace");
        if( needsWritingNs(DEFAULTNS) ) {
            write(" xmlns");
            write("=\"");
            write(namespaceURI);
            write("\"");
View Full Code Here

                    // Returning null should be fine, actually...
                    return null;
                } catch (IOException ex) {
                    throw new WstxIOException(ex);
                } catch (Exception ex) {
                    throw new XMLStreamException(ex.getMessage(), ex);
                }
            }
            return null;
        }
View Full Code Here

        /* 24-Sep-2006, TSa: We may have deferred an exception that occurred
         *   during parsing of the previous event. If so, now it needs to
         *   be thrown.
         */
        if (mPendingException != null) {
            XMLStreamException strEx = mPendingException;
            mPendingException = null;
            throw strEx;
        }

        /* Note: can not yet accurately record the location, since the
View Full Code Here

    public void fireSaxCharacterEvents(ContentHandler h)
        throws XMLStreamException, SAXException
    {
        if (h != null) {
            if (mPendingException != null) {
                XMLStreamException sex = mPendingException;
                mPendingException = null;
                throw sex;
            }
            /* Let's not defer errors; SAXTest implies
             * it's expected errors are thrown right away
View Full Code Here

            ix = mWriter.writePI(target, data);
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }
        if (ix >= 0) {
            throw new XMLStreamException("Illegal input: processing instruction content has embedded '?>' in it (index "+ix+")");
        }
    }
View Full Code Here

            }
        } catch (IOException ioe) {
            throw new WstxIOException(ioe);
        }

        throw new XMLStreamException("Unrecognized event type ("
                                     +sr.getEventType()+"); not sure how to copy");
    }
View Full Code Here

        throws XMLStreamException
    {
        // 20-Nov-2004, TSa: can check that we are in prolog
        if (mCheckStructure) {
            if (mState != STATE_PROLOG) {
                throw new XMLStreamException("Can not write DOCTYPE declaration (DTD) when not in prolog any more (state "+mState+"; start element(s) written)");
            }
            // 20-Dec-2005, TSa: and that we only output one...
            if (mDtdRootElem != null) {
                throw new XMLStreamException("Trying to write multiple DOCTYPE declarations");
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.stream.XMLStreamException

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.