Package javax.xml.parsers

Examples of javax.xml.parsers.DocumentBuilderFactory


    private List<HandlerChainType> chains;

    HandlerChainDocument(InputStream is, boolean doValidate) {
        chains = new ArrayList<HandlerChainType>();
        try {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(false);
            DocumentBuilder builder = dbf.newDocumentBuilder();
            Document srcDoc = builder.parse(is);
            dbf.setNamespaceAware(true);
            Document destDoc = builder.newDocument();
            transform(srcDoc, destDoc);

            NodeList chainNodes = destDoc.getFirstChild().getChildNodes();
            for (int i = 0; i < chainNodes.getLength(); i++) {
View Full Code Here


        // Complete
    }
   
    private DocumentBuilder getDocBuilder() throws ParserConfigurationException {
       
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        return dbf.newDocumentBuilder();
       
    }
View Full Code Here

    */
   private Document getDocument(String xml) throws XmlBlasterException {
      try {  
         java.io.StringReader reader = new java.io.StringReader(xml);
         InputSource input = new InputSource(reader);
         DocumentBuilderFactory factory = glob.getDocumentBuilderFactory();
         DocumentBuilder builder = factory.newDocumentBuilder ();
         return builder.parse(input)
      } catch (org.xml.sax.SAXException ex) {
         String reason = ex.getMessage();
         if(ex instanceof org.xml.sax.SAXParseException) {
            org.xml.sax.SAXParseException s = (org.xml.sax.SAXParseException)ex;
View Full Code Here

                   "<xmlBlaster></xmlBlaster>";
      java.io.StringReader reader = new java.io.StringReader(xml);
      org.xml.sax.InputSource input = new org.xml.sax.InputSource(reader);

      try {
         DocumentBuilderFactory dbf = requestBroker.getServerScope().getDocumentBuilderFactory();
         //dbf.setNamespaceAware(true);
         //dbf.setCoalescing(true);
         //dbf.setValidating(false);
         //dbf.setIgnoringComments(true);
         DocumentBuilder db = dbf.newDocumentBuilder ();
         xmlKeyDoc = db.parse(input);
      } catch (Exception e) {
         log.severe("Problems when building DOM tree from your XmlKey: " + e.toString());
         throw new XmlBlasterException(serverScope, ErrorCode.INTERNAL_ILLEGALSTATE, ME, "Problems when building DOM tree from your XmlKey: " + e.toString());
      }
View Full Code Here

      //input.setEncoding("UTF-8");
      //input.setEncoding("ISO-8859-2");
      //input.setSystemId("9999999999");

      try {
         DocumentBuilderFactory dbf = glob.getDocumentBuilderFactory();
         DocumentBuilder db = dbf.newDocumentBuilder();
         Document xmlDoc = db.parse(input);
        
         ByteArrayOutputStream out = XmlNotPortable.writeNode(xmlDoc.getDocumentElement());
         String response = new String(out.toByteArray());
         log.info(response);
View Full Code Here

        }

        InputStream ins = servletConfig.getServletContext()
            .getResourceAsStream("/WEB-INF/celtix-servlet.xml");
        if (ins != null) {
            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
            builderFactory.setNamespaceAware(true);
            builderFactory.setValidating(false);
           
           
            try {
                Document doc = builderFactory.newDocumentBuilder().parse(ins);
                Node nd = doc.getDocumentElement().getFirstChild();
                while (nd != null) {
                    if ("endpoint".equals(nd.getLocalName())) {
                        loadEndpoint(servletConfig, nd);
                    }
View Full Code Here

  }

  private static DocumentBuilder createBuilder()
    throws ParserConfigurationException
  {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    return factory.newDocumentBuilder();
  }
View Full Code Here

     * @throws SAXException
     */
    private Document urlToDocument(String url)
        throws Exception
    {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        builder.setEntityResolver(new XslTransformerEntityResolver(url));
        return builder.parse(new InputSource(url));
    }
View Full Code Here

       
        Document doc = null;
        try {
            WebService ws = serviceImplementation.getClass().getAnnotation(WebService.class);
            if (ws != null) {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                factory.setNamespaceAware(true);
                DocumentBuilder builder = factory.newDocumentBuilder();
                doc = builder.parse(ws.wsdlLocation());
            } else {
                LOG.severe("could not get WebService annotation from " + serviceImplementation);
            }
        } catch (Exception ex) {
View Full Code Here

        // right now, all we are interested in is an endpoint name
        // from the jbi dd.
        File metaInf = new File(rootPath, "META-INF");
        File jbiXml = new File(metaInf, "jbi.xml");
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.parse(jbiXml.toURL().toString());
           
            Element providesEl = (Element)findNode(doc.getDocumentElement(), "provides");
            endpointName = providesEl.getAttribute("endpoint-name");
        } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of javax.xml.parsers.DocumentBuilderFactory

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.