Examples of DOMImplementationRegistry


Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

    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

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

        try {

            // get DOM Implementation using DOM Registry
            System.setProperty(DOMImplementationRegistry.PROPERTY,"org.apache.xerces.dom.DOMImplementationSourceImpl");
            DOMImplementationRegistry registry =
                DOMImplementationRegistry.newInstance();

            DOMImplementationLS impl =
                (DOMImplementationLS)registry.getDOMImplementation("LS");

            // create DOMBuilder
            builder = impl.createDOMParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
           
            DOMConfiguration config = builder.getConfig();
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

    private DOMImplementation domImplementation;
    private DOMImplementationLS domImplementationLS;
   
    public AbstractJAXPDriver() {
      try {
        DOMImplementationRegistry reg = DOMImplementationRegistry.newInstance();
        domImplementation = reg.getDOMImplementation("XML 3.0"); //$NON-NLS-1$
      } catch(Throwable t) {
        throw new RuntimeException(t);
      }
      if(domImplementation==null) {
        throw new RuntimeException("Error while initializing the JAXP driver"); // $NLS-AbstractJAXPDriver.ErrorwhileinitializingtheJAXPdriv-1$
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

    return doc;
  }

  public static void saveDocument(Document doc) throws Exception
  {
    DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
    DOMImplementationLS impl = (DOMImplementationLS)registry.getDOMImplementation("LS");

    LSSerializer writer = impl.createLSSerializer();
    LSOutput output = impl.createLSOutput();

    output.setByteStream(new FileOutputStream(file));
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

                System.setProperty("javax.xml.parsers.DocumentBuilderFactory", jaxpProperty);
            }

            ByteArrayOutputStream byteArrayOutputStrm = new ByteArrayOutputStream();

            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

            DOMImplementationLS impl =
                    (DOMImplementationLS) registry.getDOMImplementation("LS");

            LSSerializer writer = impl.createLSSerializer();
            LSOutput output = impl.createLSOutput();
            output.setByteStream(byteArrayOutputStrm);
            writer.write(element, output);
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

            //Serializing and re-generating the AXIOM element using the DOM Element created using xerces
            Element element = assertion.getDOM();

            ByteArrayOutputStream byteArrayOutputStrm = new ByteArrayOutputStream();

            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

            DOMImplementationLS impl =
                    (DOMImplementationLS) registry.getDOMImplementation("LS");

            LSSerializer writer = impl.createLSSerializer();
            LSOutput output = impl.createLSOutput();
            output.setByteStream(byteArrayOutputStrm);
            writer.write(element, output);
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

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

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

      // xerces
      Element element = assertion.getDOM();

      ByteArrayOutputStream byteArrayOutputStrm = new ByteArrayOutputStream();

      DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

      DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS");

      LSSerializer writer = impl.createLSSerializer();
      LSOutput output = impl.createLSOutput();
      output.setByteStream(byteArrayOutputStrm);
      writer.write(element, output);
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

                System.setProperty("javax.xml.parsers.DocumentBuilderFactory", jaxpProperty);
            }

            ByteArrayOutputStream byteArrayOutputStrm = new ByteArrayOutputStream();

            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

            DOMImplementationLS impl =
                    (DOMImplementationLS) registry.getDOMImplementation("LS");

            LSSerializer writer = impl.createLSSerializer();
            LSOutput output = impl.createLSOutput();
            output.setByteStream(byteArrayOutputStrm);
            writer.write(element, output);
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

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