Examples of InputSource


Examples of org.xml.sax.InputSource

    // errors, or fatal errors back from validation
    MMErrorHandler errorHandler = new MMErrorHandler();   
    reader.setErrorHandler(errorHandler);
   
    // create the input stream for the xml document to be parsed
    InputSource source = new InputSource(xmlStream);
   
    try{
        reader.parse(source);
    } catch(SAXException se){
      throw new TeiidComponentException(se);
View Full Code Here

Examples of org.xml.sax.InputSource

      try {
        is = schema.getBinaryStream();
      } catch (SQLException e) {
        throw new TeiidComponentException(e);
      }
      InputSource source = new InputSource(is);
             pch.targetNameSpace = null;
         try {
                parser.parse(source, pch);
            } catch (SAXException err) {
                throw new TeiidException(err);
View Full Code Here

Examples of org.xml.sax.InputSource

       }
      public InputSource resolveEntity (String publicId, String systemId) {
          String xsd = (String)schemaMap.get(systemId);
          if (xsd != null) {
                    StringReader reader = new StringReader(xsd);
                    InputSource source = new InputSource(reader);
                    return source;                    
          }
          return null;
      }
View Full Code Here

Examples of org.xml.sax.InputSource

      log.debug("Trying to locate [{}] in classpath", fileName);
      try {
        DozerClassLoader classLoader = BeanContainer.getInstance().getClassLoader();
        URL url = classLoader.loadResource(fileName);
        InputStream stream = url.openStream();
        InputSource source = new InputSource(stream);
        source.setPublicId(publicId);
        source.setSystemId(systemId);
        log.debug("Found beanmapping XML Schema [{}] in classpath", systemId);
        return source;
      } catch (Exception ex) {
        log.error("Could not resolve beanmapping XML Schema [" + systemId + "]: not found in classpath", ex);
      }
View Full Code Here

Examples of org.xml.sax.InputSource

      ParseErrorHandler errHandler = new ParseErrorHandler();
      errHandler.setExitOnError(false);
      XMLReader parser = (XMLReader)Class.forName(parserName).newInstance();
      parser.setFeature("http://xml.org/sax/features/validation",true);
      parser.setErrorHandler(errHandler);
      parser.parse(new InputSource(new ByteArrayInputStream(b)));
      if (errHandler.hasErrors()) {
        return false;
      }
      logger.debug("XML Document is valid!");
      return true;
View Full Code Here

Examples of org.xml.sax.InputSource

  * @param systemId String system id (not used)
  */
  public InputSource resolveEntity (String publicId, String systemId) {
    logger.debug("Using the IgnoreDTDResolver...");
    StringReader reader = new StringReader("");
    return new InputSource(reader);
  }
View Full Code Here

Examples of org.xml.sax.InputSource

  {
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();

    final ImageMapXmlResourceFactory resourceFactory = new ImageMapXmlResourceFactory();
    final InputSource source = new InputSource();
    source.setCharacterStream(new StringReader(imageMapXml));
    return (ImageMap) resourceFactory.parseDirectly
        (resourceManager, source, null, Collections.EMPTY_MAP);
  }
View Full Code Here

Examples of org.xml.sax.InputSource

  public void testSimpleReportDefinition () throws IOException, ResourceException
  {
    String report = "<report></report>";
    StringReader reader = new StringReader(report);
    final InputSource source = new InputSource();
    source.setCharacterStream(reader);
    assertNotNull(ReportGenerator.getInstance().parseReport(source, new File("/tmp").toURL()));
  }
View Full Code Here

Examples of org.xml.sax.InputSource

  public void testExtendedReportDefinition () throws IOException, ResourceException
  {
    String report = "<report-definition></report-definition>";
    StringReader reader = new StringReader(report);
    final InputSource source = new InputSource();
    source.setCharacterStream(reader);
    assertNotNull(ReportGenerator.getInstance().parseReport(source, new File("/tmp").toURL()));
  }
View Full Code Here

Examples of org.xml.sax.InputSource

        rc.convertReport(url, url,
            new OutputStreamWriter (bo, "UTF-16"), "UTF-16");
        final byte[] buf = bo.toByteArray();
        final String s = new String(buf, "UTF-16");
        final ByteArrayInputStream bin = new ByteArrayInputStream(buf);
        ReportGenerator.getInstance().parseReport(new InputSource(bin), url);
      }
      catch (Exception e)
      {
        logger.debug("Failed to write or parse " + url, e);
        logger.debug (bo.toString("UTF-16"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.