Examples of newDocumentBuilder()


Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

   * @exception Exception  unspecialized error
   */
  public String parse(InputStream in) throws Exception {
    StringBuffer buff = new StringBuffer();
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse(in);

    NodeList nl = doc.getElementsByTagName("resourceadapter");
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

   * @exception Exception  unspecialized error
   */
  public String update(InputStream in, Map map) throws Exception {
    this.map = map;
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse(in);

    NodeList nl = doc.getElementsByTagName("resourceadapter");
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

     */
  public XmpReader(byte[] bytes) throws SAXException, IOException {
    try {
          DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
          fact.setNamespaceAware(true);
      DocumentBuilder db = fact.newDocumentBuilder();
          ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
          domDocument = db.parse(bais);
    } catch (ParserConfigurationException e) {
      throw new ExceptionConverter(e);
    }
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

            public void executeWorkItem(WorkItem workItem, WorkItemManager mgr) {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder;
        try {
          builder = factory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
          // TODO Auto-generated catch block
//          e.printStackTrace();
          throw new RuntimeException(e);
        }
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setIgnoringComments(true);
      factory.setCoalescing(true);
      factory.setNamespaceAware(false);
      factory.setValidating(false);
      DocumentBuilder parser = factory.newDocumentBuilder();
      Document document = parser.parse(is);
      NodeList nodes = document.getElementsByTagName("locale-config");
      for (int i = 0; i < nodes.getLength(); i++)
      {
         Node node = nodes.item(i);
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

    private List<ResultGeoCodeApi> parseResults(String xml){
        List<ResultGeoCodeApi> results = new ArrayList<ResultGeoCodeApi>();
        try {
           
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse(new ByteArrayInputStream(xml.getBytes()));
              // normalize text representation
            doc.getDocumentElement ().normalize ();
            NodeList listOfResults = doc.getElementsByTagName("Result");
            for(int i= 0; i< listOfResults.getLength(); i++){
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

    private static DocumentBuilder createDocumentBuilder()
        throws ParserConfigurationException {

        DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = fact.newDocumentBuilder();

        builder.setErrorHandler( null );
       
        return builder;
    }
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

            bout.write(b);
        }
        bout.close();
        DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
        fact.setNamespaceAware(true);
        DocumentBuilder db = fact.newDocumentBuilder();
        domDocument = db.parse(new ByteArrayInputStream(bout.toByteArray()));  
        Node n = domDocument.getFirstChild();
        while (n.getChildNodes().getLength() == 0) {
          n = n.getNextSibling();
        }
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

    private static Document buildDocument(InputStream is) {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        final Document doc;
        try {
            DocumentBuilder db = dbf.newDocumentBuilder();
            doc = db.parse(is);
        } catch (Exception e) {
            throw new IllegalStateException("buildDocument failed!", e);
        }
        return doc;
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder()

                                                    Source.class,
                                                    Service.Mode.PAYLOAD);
        assertNotNull(d);
       
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = dbf.newDocumentBuilder();

        Document document = DOMUtils.readXml(getResourceAsStream("echo-payload.xml"));

        DOMSource source = new DOMSource(document.getDocumentElement());
       
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.