Package javax.xml.parsers

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


        Document document = null;
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder parser = factory.newDocumentBuilder();
            document = parser.parse(is);
        } catch (ParserConfigurationException ex) {
            throw new ConfigurationException(new Message("PARSER_CONFIGURATION_ERROR_EXC",
                                                         LOG, location), ex);
        } catch (SAXException ex) {
View Full Code Here


        // parse
        Document document = null;
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder parser = factory.newDocumentBuilder();
            document = parser.parse(is);
        } catch (ParserConfigurationException ex) {
            throw new ConfigurationException(new Message("PARSER_CONFIGURATION_ERROR_EXC", LOG), ex);
        } catch (SAXException ex) {
            throw new ConfigurationException(new Message("PARSE_ERROR_EXC", LOG), ex);
View Full Code Here

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

   
    private Document getDocument(String str) throws Exception {
        if (null == document) {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder parser = factory.newDocumentBuilder();
            document = parser.parse(new InputSource(new ByteArrayInputStream(str.getBytes())));
        }
        return document;
    }
}
View Full Code Here

  public void testXMPSchemaBibtexElement()
    throws ParserConfigurationException {
    DocumentBuilderFactory builderFactory = DocumentBuilderFactory
      .newInstance();
    DocumentBuilder builder = builderFactory.newDocumentBuilder();
    Element e = builder.newDocument().createElement("rdf:Description");

    XMPSchemaBibtex bibtex = new XMPSchemaBibtex(e, "bibtex");

    assertEquals(e, bibtex.getElement());
View Full Code Here

            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

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

            DocumentBuilder db = dbf.newDocumentBuilder();
     
      // We don't allow users to override the Apache XML Security
      // configuration in the JRE. Users should use the standard security
      // provider mechanism instead if implementing their own
      // transform or canonicalization algorithms.
View Full Code Here

      dfactory.setNamespaceAware(true);

      // needs to validate for ID attribute nomalization
      dfactory.setValidating(true);

      DocumentBuilder db = dfactory.newDocumentBuilder();

      /*
       * for some of the test vectors from the specification,
       * there has to be a validatin parser for ID attributes, default
       * attribute values, NMTOKENS, etc.
View Full Code Here

      DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();

      // needs to validate for ID attribute nomalization
      dfactory.setNamespaceAware(true);

      DocumentBuilder db = dfactory.newDocumentBuilder();

      /*
       * for some of the test vectors from the specification,
       * there has to be a validatin parser for ID attributes, default
       * attribute values, NMTOKENS, etc.
View Full Code Here

            try {
                DocumentBuilderFactory dbf =
                    DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        dbf.setAttribute("http://xml.org/sax/features/namespaces", Boolean.TRUE);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document d = db.parse(
            new InputSource(new StringReader(fragment)));

        Element fragElt = (Element) _contextDocument.importNode(
             d.getDocumentElement(), true);
View Full Code Here

 
  void convertToNodes() throws CanonicalizationException, ParserConfigurationException, IOException, SAXException{
    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
        dfactory.setValidating(false);       
        dfactory.setNamespaceAware(true);
        DocumentBuilder db = dfactory.newDocumentBuilder();
        // select all nodes, also the comments.       
        try {
           db.setErrorHandler(new com.sun.org.apache.xml.internal.security.utils
              .IgnoreAllErrorHandler());
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.