Examples of InputSource


Examples of org.xml.sax.InputSource

                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

Examples of org.xml.sax.InputSource

    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

Examples of org.xml.sax.InputSource

    public void parse(InputStream is) throws Exception {
        //DocumentTable store = new ProfiledDocumentTable(File.createTempFile("dtm_profile", "csv"));
        IDocumentTable store = new DocumentTable();
        DocumentTableBuilder handler = new DocumentTableBuilder(store);
        XMLReader reader = getXMLReader(handler);
        reader.parse(new InputSource(new BufferedInputStream(is)));
    }
View Full Code Here

Examples of org.xml.sax.InputSource

    dozerResolver = new DozerResolver();
  }

  @Test
  public void testResolveEntity_OK() {
    InputSource inputSource = dozerResolver.resolveEntity(null, "http://nowhere.tosearch.url/beanmapping.xsd");
    assertNotNull(inputSource);
  }
View Full Code Here

Examples of org.xml.sax.InputSource

    assertNotNull(inputSource);
  }

  @Test
  public void testResolveEntity_Direct() {
    InputSource inputSource = dozerResolver.resolveEntity(null, "beanmapping.xsd");
    assertNotNull(inputSource);
  }
View Full Code Here

Examples of org.xml.sax.InputSource

                    ;
                    LocationResponseHandler handler=new LocationResponseHandler();
                    xr.setContentHandler(handler);
                    xr.setErrorHandler(handler);

                    xr.parse(new InputSource(connection.getInputStream()));
                    this.location=handler.loc;
                }
                catch(SAXException e) {
                    throw new RuntimeException("Unexpected error parsing ListAllMyBuckets xml", e);
                }
View Full Code Here

Examples of org.xml.sax.InputSource

        return (T) new StAXSource(factory.createXMLStreamReader(getBinaryStream()));
      } catch (XMLStreamException e) {
        throw new SQLException(e);
      }
    } else if (sourceClass == SAXSource.class) {
      return (T) new SAXSource(new InputSource(getBinaryStream()));
    } else if (sourceClass == DOMSource.class) {
      try {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder docBuilder = dbf.newDocumentBuilder();
              Node doc = docBuilder.parse(new InputSource(getBinaryStream()));
              return (T) new DOMSource(doc);
      } catch (ParserConfigurationException e) {
        throw new SQLException(e);
      } catch (SAXException e) {
        throw new SQLException(e);
View Full Code Here

Examples of org.xml.sax.InputSource

  }

  public InputSource resolveEntity(String publicId, String systemId) {
    byte[] temp = new byte[0];
    // strib...
    return new InputSource(new ByteArrayInputStream(temp));
  }
View Full Code Here

Examples of org.xml.sax.InputSource

  protected static void parseNew(InputStream in, Channel ch, devplugin.Date day,
      Hashtable<String, MutableChannelDayProgram> ht, SweDBTvDataService dataService) throws Exception {
    SAXParserFactory fac = SAXParserFactory.newInstance();
    fac.setValidating(false);
    SAXParser sax = fac.newSAXParser();
    InputSource input = new InputSource(in);
    input.setSystemId(new File("/").toURI().toURL().toString());
    sax.parse(input, new DataHydraDayParser(ch, ht, dataService));
  }
View Full Code Here

Examples of org.xml.sax.InputSource

            if (uri == null) {
                return;
            }
            is = uri.openStream();
            InputSource ip = new InputSource(is);
            ip.setSystemId(uri.toExternalForm());

            // Parse the web application deployment descriptor
            TreeNode webtld = null;
            // altDDName is the absolute path of the DD
            if (altDDName != null) {
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.