Package org.w3c.dom.bootstrap

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry


                domImplementationLS = (DOMImplementationLS) domImplementation
                        .getFeature("LS", "3.0");
            }
            catch (final NoSuchMethodError nsme) {
                // Fall back to default LS
                DOMImplementationRegistry registry = null;
                try {
                    registry = DOMImplementationRegistry.newInstance();
                }
                catch (final Exception e) {
                    // DOMImplementationRegistry not available. Falling back to
                    // TrAX.
                    writeXml(outputStream, document);
                    return;
                }
                if (registry != null) {
                    domImplementationLS = (DOMImplementationLS) registry
                            .getDOMImplementation("LS");
                }
                else {
                    // DOMImplementationRegistry not available. Falling back to
                    // TrAX.
View Full Code Here


    protected String normalizeXML(String xml) throws Exception {
        // Remove all white space adjoining tags ("trim all elements")
        xml = xml.replaceAll("\\s*<", "<");
        xml = xml.replaceAll(">\\s*", ">");

        DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
        DOMImplementationLS domLS = (DOMImplementationLS) registry.getDOMImplementation("LS");
        LSParser lsParser = domLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);

        LSInput input = domLS.createLSInput();
        input.setStringData(xml);
        Document document = lsParser.parse(input);
View Full Code Here

        // Try to get the DOMImplementation from doc first before
        // defaulting to the sun implementation.
        if (docImpl != null && docImpl.hasFeature("LS", "3.0")) {
            impl = (DOMImplementationLS)docImpl.getFeature("LS", "3.0");
        } else {
            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
            impl = (DOMImplementationLS)registry.getDOMImplementation("LS");
            if (impl == null) {
                System.setProperty(DOMImplementationRegistry.PROPERTY,
                                   "com.sun.org.apache.xerces.internal.dom.DOMImplementationSourceImpl");
                registry = DOMImplementationRegistry.newInstance();
                impl = (DOMImplementationLS)registry.getDOMImplementation("LS");
            }
        }
        LSOutput output = impl.createLSOutput();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        output.setByteStream(byteArrayOutputStream);
View Full Code Here

  private VanillaCajaHtmlParser parser;
  private VanillaCajaHtmlSerializer serializer;

  @Before
  public void setUp() throws Exception {
    DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
    // Require the traversal API
    DOMImplementation domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0");
    parser = new VanillaCajaHtmlParser(domImpl, true);
    serializer = new VanillaCajaHtmlSerializer();
  }
View Full Code Here

  private VanillaCajaHtmlParser parser;
  private VanillaCajaHtmlSerializer serializer;

  @Before
  public void setUp() throws Exception {
    DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
    // Require the traversal API
    DOMImplementation domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0");
    parser = new VanillaCajaHtmlParser(domImpl, true);
    serializer = new VanillaCajaHtmlSerializer();
  }
View Full Code Here

    DOMImplementation domImpl;

    public DOMImplementationProvider() {
      try {
        DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
        // Require the traversal API
        domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0");
      } catch (ClassNotFoundException e) {
        // Try another
      } catch (InstantiationException e) {
        // Try another
      } catch (IllegalAccessException e) {
View Full Code Here

        if (docImpl != null && docImpl.hasFeature("LS", "3.0")) {
            impl = (DOMImplementationLS)docImpl.getFeature("LS", "3.0");
        } else {
            System.setProperty(DOMImplementationRegistry.PROPERTY,
                "com.sun.org.apache.xerces.internal.dom.DOMImplementationSourceImpl");
            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
            impl = (DOMImplementationLS)registry.getDOMImplementation("LS");
        }
        LSOutput output = impl.createLSOutput();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        output.setByteStream(byteArrayOutputStream);
        LSSerializer writer = impl.createLSSerializer();
View Full Code Here

        if (docImpl != null && docImpl.hasFeature("LS", "3.0")) {
            impl = (DOMImplementationLS)docImpl.getFeature("LS", "3.0");
        } else {
            System.setProperty(DOMImplementationRegistry.PROPERTY,
                "com.sun.org.apache.xerces.internal.dom.DOMImplementationSourceImpl");
            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
            impl = (DOMImplementationLS)registry.getDOMImplementation("LS");
        }
        LSOutput output = impl.createLSOutput();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        output.setByteStream(byteArrayOutputStream);
        LSSerializer writer = impl.createLSSerializer();
View Full Code Here

        {
            LSInput aLSInput = null;
           
            if( m_aDOMImplLS == null && !m_bGetDOMImplLSFailed )
            {
                DOMImplementationRegistry aDOMReg = null;

                try
                {       
                    aDOMReg = DOMImplementationRegistry.newInstance();
                }
                catch( ClassNotFoundException e )
                {
                    m_aLogger.logFatalError(e.getMessage());
                }
                catch( InstantiationException e )
                {
                    m_aLogger.logFatalError(e.getMessage());
                }
                catch( IllegalAccessException e )
                {
                    m_aLogger.logFatalError(e.getMessage());
                }
                DOMImplementation aDOMImpl = aDOMReg.getDOMImplementation( "LS 3.0");
                if( aDOMImpl != null )
                {
                    m_aDOMImplLS = (DOMImplementationLS)aDOMImpl;
                }
                else
View Full Code Here

    DOMImplementation domImpl;

    public DOMImplementationProvider() {
      try {
        DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
        // Require the traversal API
        domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0");
      } catch (Exception e) {
        // Try another
      }
      // This is ugly but effective
      try {
View Full Code Here

TOP

Related Classes of org.w3c.dom.bootstrap.DOMImplementationRegistry

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.