Package org.xml.sax

Examples of org.xml.sax.InputSource


    JAXBContext context = JAXBContext.newInstance(new Class[] {TranslatorMetaDataGroup.class});
      Unmarshaller um = context.createUnmarshaller();     
      InputStream is = file.openStream();

      try{
         InputSource input = new InputSource(is);
         input.setSystemId(file.toURI().toString());
         XMLReader reader = XMLReaderFactory.createXMLReader();
         reader.setEntityResolver(new JBossEntityResolver());
         SAXSource source = new SAXSource(reader, input);
         JAXBElement<TranslatorMetaDataGroup> elem = um.unmarshal(source, TranslatorMetaDataGroup.class);
         TranslatorMetaDataGroup deployment = elem.getValue();
View Full Code Here


      Mapping mapping = new Mapping();
      try {
  mapping.loadMapping(f1.getPath());
  Unmarshaller unmar = new Unmarshaller(mapping);
  unmar.setDebug(true);
  baseobj=(JoBoBase)unmar.unmarshal(new InputSource(f2.getPath()));
 
  log.info("configured from XML");
       
      } catch (Exception e) {
  log.error(e.getMessage());
View Full Code Here

                                        new CustomXmlSchemaURIResolver(resourceMap, synCfg));
                                // Axis 2 also needs a WSDLLocator for WSDL 1.1 documents
                                if (wsdlToAxisServiceBuilder instanceof WSDL11ToAxisServiceBuilder) {
                                    ((WSDL11ToAxisServiceBuilder)
                                            wsdlToAxisServiceBuilder).setCustomWSDLResolver(
                                            new CustomWSDLLocator(new InputSource(wsdlInputStream),
                                                    wsdlURI != null ? wsdlURI.toString() : "",
                                                    resourceMap, synCfg));
                                }
                            } else {
                                //if the resource map isn't available ,
                                //then each import URIs will be resolved using base URI
                                wsdlToAxisServiceBuilder.setCustomResolver(
                                        new CustomXmlSchemaURIResolver());
                                // Axis 2 also needs a WSDLLocator for WSDL 1.1 documents
                                if (wsdlToAxisServiceBuilder instanceof WSDL11ToAxisServiceBuilder) {
                                    ((WSDL11ToAxisServiceBuilder)
                                            wsdlToAxisServiceBuilder).setCustomWSDLResolver(
                                            new CustomWSDLLocator(new InputSource(wsdlInputStream),
                                                    wsdlURI != null ? wsdlURI.toString() : ""));
                                }
                            }
                        }
                        if (trace()) {
View Full Code Here

        userDefSchemaResolver.init(resourceMap, synCfg, wsdlKey);

        wsdlToAxisServiceBuilder.setCustomResolver(userDefSchemaResolver);
        if (wsdlToAxisServiceBuilder instanceof WSDL11ToAxisServiceBuilder) {
            UserDefinedWSDLLocator userDefWSDLLocator = (UserDefinedWSDLLocator) wsdlClzzObject;
            userDefWSDLLocator.init(new InputSource(wsdlInputStream),
                    wsdlURI != null ? wsdlURI.toString() : "", resourceMap, synCfg,
                    wsdlKey);
            ((WSDL11ToAxisServiceBuilder) wsdlToAxisServiceBuilder).
                    setCustomWSDLResolver(userDefWSDLLocator);
        }
View Full Code Here

                    log.debug("Cannot create a URLConnection for given URL : " + uri);
                }
                return null;
            }
            BufferedInputStream urlInStream = new BufferedInputStream(connection.getInputStream());
            return new InputSource(urlInStream);
        } catch (MalformedURLException e) {
            handleException("Invalid URL ' " + uri + " '", e);
        } catch (IOException e) {
            handleException("IOError when getting a stream from given url : " + uri, e);
        }
View Full Code Here

    /**
     * read an InputStream with xml-content.
     */
    public INode read(InputStream in, INode helmaNode)
               throws ParserConfigurationException, SAXException, IOException {
        return read(new InputSource(in), helmaNode);
    }
View Full Code Here

    /**
     * read an character reader with xml-content.
     */
    public INode read(Reader in, INode helmaNode)
               throws ParserConfigurationException, SAXException, IOException {
        return read(new InputSource(in), helmaNode);
    }
View Full Code Here

     *
     * @throws RuntimeException ...
     */
    public INode convertFromString(String xml, INode helmaNode)
                            throws RuntimeException {
        Document document = XmlUtil.parse(new InputSource(new StringReader(xml)));

        if ((document != null) && (document.getDocumentElement() != null)) {
            return convert(document.getDocumentElement(), helmaNode, new HashMap());
        } else {
            return helmaNode;
View Full Code Here

                new URL(obj.toString());

                doc = parser.parse(obj.toString());
            } catch (MalformedURLException nourl) {
                // if not a URL, maybe it is the XML itself
                doc = parser.parse(new InputSource(new StringReader(obj.toString())));
            }
        } else if (obj instanceof InputStream) {
            doc = parser.parse(new InputSource((InputStream) obj));
        } else if (obj instanceof Reader) {
            doc = parser.parse(new InputSource((Reader) obj));
        } else {
            throw new RuntimeException("Unrecognized argument to parseXml: " + obj);
        }

        doc.normalize();
View Full Code Here

    private static HTMLDocument getHtmlDocument(Reader reader)
            throws IOException, SAXException {
        XMLReaderAdapter parser = new XMLReaderAdapter(new Parser());
        HTMLBuilder builder = new HTMLBuilder();
        parser.setDocumentHandler(builder);
        parser.parse(new InputSource(reader));
        return builder.getHTMLDocument();
    }
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.