Examples of DocumentBuilderFactoryImpl


Examples of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

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

Examples of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

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

Examples of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

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

Examples of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

       
        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

Examples of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

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

Examples of org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

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);
        return builder.build();
    }
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.