Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlException


    public static XmlObject parse(File file) throws IOException, XmlException {
        ArrayList errors = new ArrayList();
        XmlObject parsed = XmlObject.Factory.parse(file, createXmlOptions(errors));
        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        return parsed;
    }
View Full Code Here


            parsed = XmlObject.Factory.parse(url, createXmlOptions(errors));
        } finally {
            currentThread.setContextClassLoader(oldcl);
        }
        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        return parsed;
    }
View Full Code Here

    public static XmlObject parse(InputStream is) throws IOException, XmlException {
        ArrayList errors = new ArrayList();
        XmlObject parsed = XmlObject.Factory.parse(is, createXmlOptions(errors));
        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        return parsed;
    }
View Full Code Here

    public static XmlObject parse(String xml) throws XmlException {
        ArrayList errors = new ArrayList();
        XmlObject parsed = XmlObject.Factory.parse(xml, createXmlOptions(errors));
        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        return parsed;
    }
View Full Code Here

    public static XmlObject parse(Element element) throws XmlException {
        ArrayList errors = new ArrayList();
        XmlObject parsed = XmlObject.Factory.parse(element, createXmlOptions(errors));
        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        return parsed;
    }
View Full Code Here

                    StringBuilder buf = new StringBuilder("Invalid deployment descriptor: errors:\n\n");
                    for (Object o : errors) {
                        buf.append(o).append("\n\n");
                    }
                    buf.append("Descriptor:\n").append(dd.toString()).append("\n");
                    throw new XmlException(buf.toString(), null, errors);
                }
            }
        } catch (NullPointerException e) {
            //ignore
        } catch (AssertionError e) {
View Full Code Here

    static XmlObject parseWithNamespaces(Element element, Map namespaceMap) throws XmlException {
        ArrayList errors = new ArrayList();
        XmlOptions xmlOptions = XmlBeansUtil.createXmlOptions(errors);
        SchemaDocument parsed = SchemaDocument.Factory.parse(element, xmlOptions);
        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        XmlCursor cursor = parsed.newCursor();
        try {
            cursor.toFirstContentToken();
            for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) {
View Full Code Here

    try {
      return getTargetPart(
        getCorePart().getRelationship(master.getId2())
      );
    } catch(InvalidFormatException e) {
      throw new XmlException(e);
    }
  }
View Full Code Here

    try {
      return getTargetPart(
          getCorePart().getRelationship(slide.getId2())
      );
    } catch(InvalidFormatException e) {
      throw new XmlException(e);
    }
  }
View Full Code Here

            if ("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN".equals(publicId)) {
                cmpVersion = "1.x";
            } else if ("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN".equals(publicId)) {
                cmpVersion = null;//2.x is the default "2.x";
            } else {
                throw new XmlException("Unrecognized document type: " + publicId);
            }
            String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd";
            String version = "2.1";
            SchemaConversionUtils.convertToSchema(cursor, SchemaConversionUtils.J2EE_NAMESPACE, schemaLocationURL, version);
            //play with message-driven
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlException

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.