Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlRuntimeException


                return Class.forName("org.apache.xmlbeans.impl.jaxb.compiler.JaxbCodeGenerator", false, SchemaCodeGenerator.class.getClassLoader())
                    .getMethod("compile", new Class[] {SchemaTypeSystem.class, List.class, File.class, File.class, XmlErrorWatcher.class });
            }
            catch (Exception e)
            {
                XmlRuntimeException e2 =  new XmlRuntimeException("Cannot load JaxbCodeGenerator: verify that xbean.jar is on the classpath");
                e2.initCause(e);
                throw e2;
            }
        }
View Full Code Here


            {
                _master._nextEvent = getNextEvent();
            }
            catch ( XMLStreamException e )
            {
                throw new XmlRuntimeException( e );
            }
           
            _master._initialized = true;
        }
    }
View Full Code Here

        {
            return selectNodes(node);
        }
        catch (JaxenException e)
        {
            throw new XmlRuntimeException(e);
        }
    }
View Full Code Here

            runAll(doc, xpath);
        }
        catch (Exception e)
        {
            throw new XmlRuntimeException(e);
        }
    }
View Full Code Here

            Assert.assertTrue("------------  Found difference:" + expresionNumber + " " + resultNumber +
                " actual=\n'" + actual + "'\nexpected=\n'" + expected + "'\ndiagnostic=" + diag , match);
        }
        catch (XmlException e)
        {
            throw new XmlRuntimeException(e);
        }
        catch (IOException e)
        {
            throw new XmlRuntimeException(e);
        }
    }
View Full Code Here

            fw.write(content);
            fw.close();
        }
        catch (FileNotFoundException e)
        {
            throw new XmlRuntimeException(e);
        }
        catch (IOException e)
        {
            throw new XmlRuntimeException(e);
        }
    }
View Full Code Here

        {
            Locale.autoTypeDocument( c, null, null );
        }
        catch (XmlException e )
        {
            throw new XmlRuntimeException( e );
        }

        c.release();
       
        return doc;
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.startElement(_locale.makeQualifiedQName(uri, qName));

            if (_wantLineNumbers)
            {
                _context.bookmark(
                    new XmlLineNumber(_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 attrUri = atts.getValue(i);

                    if (attrUri.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, attrUri);
                }
View Full Code Here

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

                throw new XmlRuntimeException(err.toString(), null, err);
            }
        }
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.startElement(_locale.makeQualifiedQName(uri, qName));

            if (_wantLineNumbers)
            {
                _context.bookmark(
                    new XmlLineNumber(_startLocator.getLineNumber(),
                        _startLocator.getColumnNumber() - 1, -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 attrUri = atts.getValue(i);

                    if (attrUri.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, attrUri);
                }
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.