Package org.xml.sax

Examples of org.xml.sax.SAXParseException


                    if (!context.isIgnoringProjectTag()) {
                        baseDir = value;
                    }
                } else {
                    // XXX ignore attributes in a different NS ( maybe store them ? )
                    throw new SAXParseException("Unexpected attribute \"" + attrs.getQName(i)
                                                + "\"", context.getLocator());
                }
            }

            // XXX Move to Project ( so it is shared by all helpers )
View Full Code Here


                        extensionPointMissing = OnMissingExtensionPoint.valueOf(value);
                    } catch (IllegalArgumentException e) {
                        throw new BuildException("Invalid onMissingExtensionPoint " + value);
                    }
                } else {
                    throw new SAXParseException("Unexpected attribute \"" + key + "\"", context
                                                .getLocator());
                }
            }

            if (name == null) {
                throw new SAXParseException("target element appears without a name attribute",
                                            context.getLocator());
            }

            String prefix = null;
            boolean isInIncludeMode =
View Full Code Here

        case LowLevelCAS.TYPE_CLASS_SHORT:
        case LowLevelCAS.TYPE_CLASS_LONG:
        case LowLevelCAS.TYPE_CLASS_DOUBLE:
        case LowLevelCAS.TYPE_CLASS_FS:
          if (featVals.size() != 1) {
            throw new SAXParseException(I18nUtil.localizeMessage(
                    UIMAException.STANDARD_MESSAGE_CATALOG, Locale.getDefault(),
                    "multiple_values_unexpected",
                    new Object[] { ts.ll_getFeatureForCode(featCode).getName() }), locator);
          } else {
            handleFeature(addr, featCode, (String) featVals.get(0));
View Full Code Here

        errors.add( (SAXParseException) throwable );
      }

      boolean isV1Schema = false;
      if ( errors.size() != 0 ) {
        SAXParseException exception = errors.get( 0 );
        final String errorMessage = exception.getMessage();
        //does the error look like a schema mismatch?
        isV1Schema = doc != null
            && errorMessage.contains("1.0")
            && errorMessage.contains("2.0")
            && errorMessage.contains("version");
View Full Code Here

        }
        if (locator != null) {
            String error = "Error at (" + locator.getLineNumber() + ", " +
                    locator.getColumnNumber() + ": " + message;
            if (e != null) {
                return new SAXParseException(error, locator, e);
            } else {
                return new SAXParseException(error, locator);
            }
        }
        log.error("No Locator!");
        if (e != null) {
            return new SAXException(message, e);
View Full Code Here

    @Test
    public void testCreateRequestValidationFaultAxiom() throws Exception {
        LocatorImpl locator = new LocatorImpl();
        locator.setLineNumber(0);
        locator.setColumnNumber(0);
        SAXParseException[] exceptions = new SAXParseException[]{new SAXParseException("Message 1", locator),
                new SAXParseException("Message 2", locator),};
        MessageContext messageContext = new DefaultMessageContext(new AxiomSoapMessageFactory());
        interceptor.handleRequestValidationErrors(messageContext, exceptions);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        messageContext.getResponse().writeTo(os);
        assertXMLEqual(
View Full Code Here

                }
                catch (SOAPException e) {
                    // fall-through
                }
            }
          SAXParseException parseException = getSAXParseException(ex);
          if (parseException != null) {
            throw new InvalidXmlException("Could not parse XML", parseException);
          } else {
            throw new SoapMessageCreationException(
                "Could not create message from InputStream: " + ex.getMessage(),
View Full Code Here

    public void startElement(String uri, String localName, String qName,
        Attributes attributes) throws SAXException
    {
        if (depth++ == 0 && !"repository".equals(qName))
        {
            throw new SAXParseException(
                "Invalid OBR document, expected repository top level element", locator);
        }
        else if ("resource".equals(qName))
        {
            startResource(attributes);
View Full Code Here

                bundle = b;
            }
        }
        catch (Exception e)
        {
            throw new SAXParseException("Failed to build bundle info", locator, e);
        }
    }
View Full Code Here

                    pi.setOptional(Boolean.valueOf(attributes.getValue("optional")));
                    bundle.getBundleInfo().addImport(pi);
                }
                catch (LDAPParseException e)
                {
                    throw new SAXParseException("Failed to parse filter", locator, e);
                }
            }
            else if ("bundle".equals(name))
            {
                IRequiredBundle b = ModelElementFactory.getInstance().newModelElement(
                    IRequiredBundle.class);
                try
                {
                    LDAPExpr expr = LDAPParser.parseExpression(attributes.getValue("filter"));
                    b.setSymbolicName(decodeSymbolicName(expr, locator));
                    b.setVersions(decodeVersions(expr, locator));
                    b.setOptional(Boolean.valueOf(attributes.getValue("optional")));
                    bundle.getBundleInfo().addRequiredBundle(b);
                }
                catch (Exception e)
                {
                    System.err.println("Failed to parse filter in bundle "
                        + bundle.getBundleInfo().getSymbolicName());
                    throw new SAXParseException("Failed to parse filter in bundle "
                        + bundle.getBundleInfo().getSymbolicName(), locator, e);
                }
            }
            //else if ( "ee".equals( name ) ) {
            // TODO ignore for now...
View Full Code Here

TOP

Related Classes of org.xml.sax.SAXParseException

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.