Examples of DocumentBuilderFactory


Examples of javax.xml.parsers.DocumentBuilderFactory

        // 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

Examples of javax.xml.parsers.DocumentBuilderFactory

    return parser.getXMLReader();
  }

  public static org.w3c.dom.Document createDocument(boolean validating,
                                                    boolean namespaceAware) throws Exception {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(validating);
    factory.setNamespaceAware(namespaceAware);

    DocumentBuilder builder = factory.newDocumentBuilder();

    return builder.newDocument();
  }
View Full Code Here

Examples of mf.javax.xml.parsers.DocumentBuilderFactory

   * if the parser class cannot be instantiated.)
   */
  public void readCatalog(Catalog catalog, InputStream is)
    throws IOException, CatalogException {

    DocumentBuilderFactory factory = null;
    DocumentBuilder builder = null;

    factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(false);
    factory.setValidating(false);
    try {
      builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException pce) {
      throw new CatalogException(CatalogException.UNPARSEABLE);
    }

    Document doc = null;
View Full Code Here

Examples of net.rim.device.api.xml.parsers.DocumentBuilderFactory

 
  String m_Xml;
 
  public VoteStatus parse() {
   
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        VoteStatus voteStatus = new VoteStatus();
        try {
            DocumentBuilder builder = factory.newDocumentBuilder();
           
            ByteArrayInputStream is = new ByteArrayInputStream(m_Xml.getBytes());
           
            Document dom   = builder.parse(is);
            NodeList items = dom.getElementsByTagName("VoteStatus");
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.