Package org.xml.sax

Examples of org.xml.sax.InputSource


            is = new FastBufferedInputStream(is);
        }
        _handler.init();
        final StopWatch sw = new StopWatch();
        try {
            _reader.parse(new InputSource(is));
        } catch (IOException ie) {
            throw new DynamicError("Invalid source", ie);
        } catch (SAXException se) {
            throw new DynamicError("Parse failed", se);
        }
View Full Code Here


            return null;
        }

        Document doc = null;
        try {
            InputSource input = new InputSource(new FileInputStream(storageMetaFile));
            DOMParser parser = new DOMParser();
            parser.parse(input);
            doc = parser.getDocument();
        } catch (Exception e) {
            String details = "The operation reading collection storage metadata from " + storageMetaFile + " failed" + ". " + e.toString() + ".";
View Full Code Here

    {
    }
    public void xtestImports() throws Exception
    {
        Definition d = WSDLFactory.newInstance().newWSDLReader().readWSDL(
            new ResolverWSDLLocator(null, new InputSource(getClass().getResourceAsStream("echoImport.wsdl"))));
       
        assertNotNull(d);
    }
View Full Code Here

        service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, EchoImpl.class);
        getServiceRegistry().register(service);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        getXFire().generateWSDL(service.getSimpleName(), baos);
        System.out.println(baos.toString());
        InputSource is = new InputSource(new ByteArrayInputStream(baos.toByteArray()));
      Definition def = WSDLFactory.newInstance().newWSDLReader().readWSDL(null, is);
      javax.wsdl.Service wsdlSvc = def.getService(new QName("urn:EchoTest", "EchoTest"));
      assertNotNull(def.getPortType(new QName("urn:EchoInterface", "Echo")));
    }
View Full Code Here

    public void testBuildFromXML()
        throws Exception
    {
        final String data = "<element/>";
        final InputSource input = new InputSource();
        input.setCharacterStream( new StringReader( data ) );
        final Configuration configuration = ConfigurationUtil.buildFromXML( input );
        assertEquals( "configuration.name", "element", configuration.getName() );
        assertEquals( "configuration.path", "", configuration.getPath() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
    }
View Full Code Here

      try {
        docBuilder  = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      } catch (Exception e) {
        System.err.println(e.getMessage());
      }
      InputSource in = new InputSource(oUrl.openStream());
      doc = docBuilder.parse(in);
    }
    catch (SAXException ex) {
      log.severe("Error parsing xmlString from file " + filename);
      ex.printStackTrace();
View Full Code Here

      boolean dumpIt = false;
      if (argv.length == 2) dumpIt = true;

      Enumeration iter;
      int num_nodes;
      InputSource input;

      Properties prop = System.getProperties();
      prop.put("org.xml.sax.parser", parser_name);
      System.setProperties(prop);

      // Query: xmlBlaster/key/AGENT[@id=\"192.168.124.10\"]  xmlBlaster/key/AGENT/DRIVER[@id=\"FileProof\"]  xmlBlaster/key[@oid=\"2\"]
      // Time 1: For 7 <key> blocks on 266 MHz AMD Linux, JDK 1.2
      // Time 2: For 600 <key> blocks on 266 MHz AMD Linux, JDK 1.2

      try
      {
         StopWatch inputTime = new StopWatch();
         input = new InputSource(createURL(argv[0]));           // [ 29 millis ] [ 28 millis ]
         System.out.println("Read file" + inputTime.nice());

         StopWatch mgrTime = new StopWatch();
         XtOmQueryMgr query_mgr = new XtOmQueryMgr();           // [ 588 millis ] [ 612 millis ]
         System.out.println("Instantiate DomQueryMgr" + mgrTime.nice());
View Full Code Here

         // Query: xmlBlaster/key/AGENT[@id=\"192.168.124.10\"]  xmlBlaster/key/AGENT/DRIVER[@id=\"FileProof\"]  xmlBlaster/key[@oid=\"2\"]
         // Time 1: For 7 <key> blocks on 266 MHz AMD Linux, JDK 1.2
         // Time 2: For 600 <key> blocks on 266 MHz AMD Linux, JDK 1.2

         StopWatch inputTime = new StopWatch();
         InputSource input = new InputSource(createURL(argv[0]));       // [ 20 millis ]
         System.out.println("Read file" + inputTime.nice());

         StopWatch xmlprocTime = new StopWatch();
         XMLProcessorImpl xmlproc = new SunXMLProcessorImpl();          // [ 75 millis ] [ 60 millis ]
         System.out.println("Instantiate SunXMLProcessorImpl" + xmlprocTime.nice());
View Full Code Here

            systemId = getWsdlUrl(wsdlsource);
        } catch (IOException ioe) {
            throw new ToolException(ioe);
        }

        return validate(new InputSource(systemId), schemas, deep);

    }
View Full Code Here

    public Document validate(InputStream wsdlsource, String[] schemas) throws Exception {
        schemas = addSchemas(defaultSchemas, schemas);
        setExternalSchemaLocations(schemas);
        StackTraceErrorHandler handler = setErrorHandler();
        Document doc = doValidation(new InputSource(wsdlsource), false);

        if (!handler.isValid()) {
            throw new SAXException(handler.getErrorMessages());
        }
        return doc;
View Full Code Here

TOP

Related Classes of org.xml.sax.InputSource

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.