Package javax.xml.parsers

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


      //input.setSystemId("9999999999");
      final String ME = "DOMParser";
      if (glob == null) glob = Global.instance();
      try {
         DocumentBuilderFactory dbf = glob.getDocumentBuilderFactory();
         DocumentBuilder db = dbf.newDocumentBuilder();
         return db.parse(input);
      } catch (javax.xml.parsers.ParserConfigurationException e) {
         log.severe("Problems when building DOM parser: " + e.toString() + "\n" + xmlKey_literal);
         throw new XmlBlasterException(glob, ErrorCode.RESOURCE_CONFIGURATION, ME, "Problems when building DOM tree from your XML-ASCII string\n" + xmlKey_literal, e);
      } catch (java.io.IOException e) {
View Full Code Here


          .setIgnoringElementContentWhitespace(getIgnoringElementContentWhitespace(
              messageName, system));
      factory.setValidating(getValidating(messageName, system));
      factory.setNamespaceAware(getNamespaceAware(messageName, system));

      docBuilder = factory.newDocumentBuilder();
      docBuilder.setErrorHandler(new XParserErrorHandler());
    } // try
    catch (ParserConfigurationException e)
    {
      throw new XException(Constants.LOCATION_INTERN,
View Full Code Here

    Iterator<String> it = xmlFileList.iterator();
    while(it.hasNext()){
      String fileName = it.next();
      try {
        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
        Document doc = docBuilder.parse (new File(fileName));
        System.out.println("Retrieving Metric List from xml file: "+fileName);
        // normalize text representation
        doc.getDocumentElement ().normalize ();
View Full Code Here

          String fileName = fileIt.next();
          count++;
          try{
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();

            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse (new File(fileName));
            System.out.println("Gethering metric info from from xml file: "+fileName);
            // normalize text representation
   
     
View Full Code Here

        String fileName = it.next();

        try{
          DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();

          DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
          Document doc = docBuilder.parse (new File(fileName));
          System.out.println("Gethering metric info from from xml file: "+fileName);
          // normalize text representation
          doc.getDocumentElement ().normalize ();
View Full Code Here

    boolean defaultEnabled = false;
    try {
      DocumentBuilderFactory factory = DocumentBuilderFactory
          .newInstance();
      factory.setNamespaceAware(true);
      DocumentBuilder domBldr = factory.newDocumentBuilder();
      Document doc = domBldr.parse(url);
      if (doc != null) {
        Element root = doc.getDocumentElement();
        NodeList nl = root.getElementsByTagName(ELM_SHORT_NAME);
        if (nl != null && nl.getLength() > 0) {
View Full Code Here

            if (localXSD25 != null) {
                factory.setAttribute(SCHEMA_SOURCE_PROPERTY, localXSD25.toString());
            } else {
                factory.setAttribute(SCHEMA_SOURCE_PROPERTY, null);
            }
            DocumentBuilder builder = factory.newDocumentBuilder();
            builder.setEntityResolver(this);
            builder.setErrorHandler(this);
            this.rethrowValidationExceptions = true;
            return builder.parse(webXmlFile);
        } catch (Throwable errV25) {
View Full Code Here

                if (localXSD24 != null) {
                    factory.setAttribute(SCHEMA_SOURCE_PROPERTY, localXSD24.toString());
                } else {
                    factory.setAttribute(SCHEMA_SOURCE_PROPERTY, null);
                }
                DocumentBuilder builder = factory.newDocumentBuilder();
                builder.setEntityResolver(this);
                builder.setErrorHandler(this);
                this.rethrowValidationExceptions = true;
                return builder.parse(webXmlFile);
            } catch (Throwable errV24) {
View Full Code Here

    }
   
    private Document parseAsV23Webapp(File webXmlFile) throws ParserConfigurationException,
            SAXException, IOException {
        DocumentBuilderFactory factory = getBaseDBF();
        DocumentBuilder builder = factory.newDocumentBuilder();
        builder.setEntityResolver(this);
        builder.setErrorHandler(this);
        return builder.parse(webXmlFile);
    }
   
View Full Code Here

            factory.setValidating(false);
            factory.setNamespaceAware(false);
            factory.setIgnoringComments(true);
            factory.setCoalescing(true);
            factory.setIgnoringElementContentWhitespace(true);
            DocumentBuilder builder = factory.newDocumentBuilder();
            return builder.parse(in);
        } catch (Throwable errParser) {
            throw new WinstoneException(REALM_RESOURCES
                    .getString("FileRealm.XMLParseError"), errParser);
        }
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.