Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlRuntimeException


            {
                return null;
            }
            catch ( Exception e )
            {
                throw new XmlRuntimeException( e.getMessage(), e );
            }
        }
View Full Code Here


                r._props.setEncoding( (String) _m_getEncoding.invoke( _xr, null ) );
                r._props.setVersion ( (String) _m_getVersion .invoke( _xr, null ) );
            }
            catch ( Exception e )
            {
                throw new XmlRuntimeException( e.getMessage(), e );
            }
        }
View Full Code Here

                    new DefaultSaxLoader(
                        SAXParserFactory.newInstance().newSAXParser().getXMLReader() );
            }
            catch ( Throwable e )
            {
                throw new XmlRuntimeException( e.getMessage(), e );
            }
        }
View Full Code Here

                    xr.setErrorHandler( this );
                    xr.setEntityResolver( this );
                }
                catch ( Throwable e )
                {
                    throw new XmlRuntimeException( e.getMessage(), e );
                }
            }
        }
View Full Code Here

                XmlError err =
                    XmlError.forMessage(
                        "Use of undefined namespace prefix: " +
                            qName.substring( 0, qName.indexOf( ':' ) ));

                throw new XmlRuntimeException( err.toString(), null, err );
            }

            _context.begin( localName, namespaceURI );

            // BUGBUG - do more of the following to get line number for
            // as many parts of the XML as we can
            if (_wantLineNumbers)
            {
                _context.lineNumberAnnotation(
                    _startLocator.getLineNumber(),
                    _startLocator.getColumnNumber(),
                    -1 );
            }

            for ( int i = 0, len = atts.getLength() ; i < len ; i++ )
            {
                String aqn = atts.getQName( i );

                if (aqn.equals( "xmlns" ))
                {
                    _context.xmlns( "", atts.getValue( i ) );
                }
                else if (aqn.startsWith( "xmlns:" ))
                {
                    String prefix = aqn.substring( 6 );

                    if (prefix.length() == 0)
                    {
                        XmlError err =
                            XmlError.forMessage( "Prefix not specified", XmlError.SEVERITY_ERROR );

                        throw new XmlRuntimeException( err.toString(), null, err );
                    }

                    String uri = atts.getValue( i );

                    if (uri.length() == 0)
                    {
                        XmlError err =
                            XmlError.forMessage(
                                "Prefix can't be mapped to no namespace: " + prefix,
                                XmlError.SEVERITY_ERROR );

                        throw new XmlRuntimeException( err.toString(), null, err );
                    }

                    _context.xmlns( prefix, uri );
                }
                else
View Full Code Here

        public void error ( SAXParseException e ) throws SAXException
        {
            XmlError err =
                XmlError.forMessage( "Error: " + e.getMessage(), XmlError.SEVERITY_ERROR );

            throw new XmlRuntimeException( err.toString(), null, err );
        }
View Full Code Here

                    XmlError.forMessage(
                        "Prefix can't begin with XML: " + prefix,
                        XmlError.SEVERITY_ERROR );

                throw
                    new XmlRuntimeException(
                        err.toString(), null, err );
            }
        }
View Full Code Here

    }

    void flush() { System.out.flush(); }
    void emit(String str) { System.out.println(_indent + str); flush(); }
    void emit() { System.out.println(); flush(); }
    void error(Exception e) { System.out.println(e.toString()); flush(); XmlRuntimeException e2 = new XmlRuntimeException( e.getMessage(), e ); throw e2; }
View Full Code Here

        // someday we should implement this in all the pathing engines
        // but for now it only applies to the xqrl.
        if (options.hasOption( XmlOptions.XQUERY_VARIABLE_MAP ))
        {
            throw
                new XmlRuntimeException(
                    "XmlOptions.XQUERY_VARIABLE_MAP is not allowed in XPath expressions.");
        }

        String currentNodeVar = getCurrentNodeVar( options );
View Full Code Here

                        getPath( _pathExpr, true, null ).
                            execute( r, s, p, options );
                }
                catch ( Throwable e )
                {
                    throw new XmlRuntimeException( "Can't compile path", e );
                }
            }

            return new XBeanPathEngine( _xpath, r, s );
        }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlRuntimeException

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.