Package javax.xml.parsers

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


    *      Only used by ServerPeer.createDestination(). Get rid of this when I fix that method.
    */
   public static Element stringToElement(String s) throws Exception
   {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder parser = factory.newDocumentBuilder();
      Document doc = parser.parse(new InputSource(new StringReader(s)));
      return doc.getDocumentElement();
   }

   // Attributes ----------------------------------------------------
View Full Code Here


    dbf.setValidating(false);
    dbf.setIgnoringComments(true);

    try
    {
      return dbf.newDocumentBuilder();
    }
    catch (ParserConfigurationException e)
    {
      throw new JRException("Failed to create a document builder factory", e);
    }
View Full Code Here

        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        documentBuilderFactory.setValidating(false);

        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document doc1 = documentBuilder.parse(xmlFileName);
        Document doc2 = documentBuilder.newDocument();

        doc2.appendChild(doc2.createElement("server"));
View Full Code Here

        documentBuilderFactory.setNamespaceAware(true);
        documentBuilderFactory.setValidating(false);

        try
        {
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            doc = documentBuilder.parse(xmlFile);
        }
        catch (ParserConfigurationException e)
        {
            System.out.println("Unable to locate an XML doc builder: " + e.getMessage());
View Full Code Here

      if (namespaceElement == null) {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          factory.setNamespaceAware(true);  
          DocumentBuilder builder = null;
        try {
          builder = factory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
          throw new JRException(e);
        }   
          DOMImplementation impl = builder.getDOMImplementation();
         
View Full Code Here

      {
         log.severe("Failed to find the varia/src/etc/license-info.xml under the src root");
         System.exit(1);
      }
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = factory.newDocumentBuilder();
      Document doc = db.parse(licenseInfo);
      NodeList licenses = doc.getElementsByTagName("license");
      for(int i = 0; i < licenses.getLength(); i ++)
      {
         Element license = (Element) licenses.item(i);
View Full Code Here

        }
       
        else if (testName.equals("xml-fragment")) {
            DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
            f.setNamespaceAware(true);
            DocumentBuilder db = f.newDocumentBuilder();
            org.w3c.dom.Document doc = db.parse(new InputSource(getClass().getResourceAsStream("test-xmlfragment.xml")));
            dataModel.put("node", NodeModel.wrap(doc.getDocumentElement().getFirstChild().getFirstChild()));
        }
       
        else if (testName.equals("xmlns1")) {
View Full Code Here

     * Read the testcase configurations file and build up the test suite
     */
    public void readConfig(File f) throws Exception {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        //dbf.setValidating(true);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document d = db.parse(f);
        Element root = d.getDocumentElement();
        NodeList children = root.getChildNodes();
        for (int i=0; i<children.getLength(); i++) {
            Node n = children.item(i);
View Full Code Here

  private SimpleFontExtensionHelper()
  {
    try
    {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      documentBuilder = factory.newDocumentBuilder();
      documentBuilder.setErrorHandler(this);
    }
    catch (ParserConfigurationException e)
    {
      throw new JRRuntimeException(e);
View Full Code Here

   private static String getClientName(ClassLoader loader)
      throws Exception
   {
      String clientName = null;
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      // Try META-INF/application-client.xml application-client@id first
      URL appXmlURL = loader.getResource("META-INF/application-client.xml");
      if( appXmlURL != null )
      {
         InputStream is = appXmlURL.openStream();
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.