Package org.apache.xerces.jaxp

Examples of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl


    public DOMImplementation getDOMImplementation() {
        return domImplementation;
    }
   
    protected DocumentBuilderFactory createDocumentBuilderFactory(boolean resolveEntities, boolean validate) {
        DocumentBuilderFactory dbFactory = new DocumentBuilderFactoryImpl();
        dbFactory.setNamespaceAware(true);
        dbFactory.setExpandEntityReferences(resolveEntities);
      dbFactory.setValidating(validate);
        return dbFactory;
    }
View Full Code Here


    /**
     * Initialize the document-builder factory.
     */
    private static void initDocumentBuilderFactory() {
//        DocumentBuilderFactory f = XMLParserUtils.getDocumentBuilderFactory();
        DocumentBuilderFactory f = new DocumentBuilderFactoryImpl();
        f.setNamespaceAware(true);
        __documentBuilderFactory = f;
    }
View Full Code Here

   
    private DOMTestUtil() {}
   
    public static void execute(Test test) throws Exception {
        try {
            DocumentBuilderFactory dbf = new DocumentBuilderFactoryImpl();
            dbf.setNamespaceAware(true);
            test.execute(dbf);
        } catch (Throwable ex) {
            Assert.fail("Invalid test case; execution failed with standard DOM implementation: "
                    + ex.getMessage());
        }
View Full Code Here

   * sneak into the mix.
   * </p>
   * @return the Xerces-specific implementation
   */
  public static DocumentBuilderFactory getDocumentBuilderFactory() {
    return new DocumentBuilderFactoryImpl();
  }
View Full Code Here

        }

        Document document = null;
        try {
            DocumentBuilderFactory factory =
               new DocumentBuilderFactoryImpl();
            factory.setNamespaceAware(true);
            DocumentBuilder builder = factory.newDocumentBuilder();
            document = builder.newDocument();

            Element rootElement = (Element) document.importNode(
                                                firstBodyElement,
                                                true);
View Full Code Here

import org.apache.axiom.ts.dom.document.TestLookupNamespaceURIWithEmptyDocument;
import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;

public class XercesTest extends TestCase {
    public static TestSuite suite() {
        DocumentBuilderFactory dbf = new DocumentBuilderFactoryImpl();
        dbf.setNamespaceAware(true);
        DOMTestSuiteBuilder builder = new DOMTestSuiteBuilder(dbf);
       
        // XERCESJ-1582
        builder.exclude(TestLookupNamespaceURIWithEmptyDocument.class);
       
View Full Code Here

   * @return the node
   */
 
  public static Node convertStringToNode(String s, BPELResource bpelResource) {
    // Create DOM document
    DocumentBuilderFactory factory = new DocumentBuilderFactoryImpl();
    factory.setNamespaceAware(true);
    factory.setValidating(false);
   
    String namespaceURI = bpelResource.getNamespaceURI();
    if (bpelResource.getOptionUseNSPrefix()) {
            String prefix = "bpws";
            s = "<"+prefix+":from xmlns:"+prefix+"=\""+namespaceURI+"\">" + s + "</"+prefix+":from>";
    } else {
      s = "<from xmlns=\""+namespaceURI+"\">" + s + "</from>";
    }
   
    try {     
      StringReader sr = new StringReader(s);
      DocumentBuilder builder = factory.newDocumentBuilder();   
      InputSource source = new InputSource(sr);
      source.setEncoding("UTF8");
      Document document = builder.parse(source);
      return document.getDocumentElement();
    }
View Full Code Here

    }
  }   
   
  protected Document load(StringWriter writer) {
    // Create DOM document
    DocumentBuilderFactory factory = new DocumentBuilderFactoryImpl();
    factory.setNamespaceAware(true);
    factory.setValidating(false);
       
    try {
      StringBufferInputStream stream = new StringBufferInputStream(writer.getBuffer().toString());
      DocumentBuilder builder = factory.newDocumentBuilder();
      InputStreamReader reader = new InputStreamReader(stream, "UTF8");
      InputSource source = new InputSource(reader);
      source.setEncoding("UTF8");
      Document document = builder.parse(source);
      return document;
View Full Code Here

   * sneak into the mix.
   * </p>
   * @return the Xerces-specific implementation
   */
  public static DocumentBuilderFactory getDocumentBuilderFactory() {
    return new DocumentBuilderFactoryImpl();
  }
View Full Code Here

       
        if(!isHtml) {
          // try to load org.apache.xerces.jaxp.DocumentBuilderFactoryImpl, oracle impl sucks
          DocumentBuilderFactory factory = null;
          try{
            factory = new DocumentBuilderFactoryImpl();
          }
          catch(Throwable t) {
            factory = DocumentBuilderFactory.newInstance();
          }
         
View Full Code Here

TOP

Related Classes of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

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.