Examples of DOMImplementationRegistry


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

            inputs.add(input);
        }

        System.setProperty(DOMImplementationRegistry.PROPERTY,
                           "org.apache.xerces.dom.DOMXSImplementationSourceImpl");
        DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

        XSImplementation impl = (XSImplementation)registry.getDOMImplementation("XS-Loader");

        XSLoader schemaLoader = impl.createXSLoader(null);
        schemaLoader.getConfig().setParameter("validate", Boolean.TRUE);
        schemaLoader.getConfig().setParameter("error-handler", new DOMErrorHandler() {
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

    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

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

            MarshallerFactory marshallerFactory = org.opensaml.xml.Configuration.getMarshallerFactory();
            Marshaller marshaller = marshallerFactory.getMarshaller(xmlObject);
            Element element = marshaller.marshall(xmlObject);

            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);
            return byteArrayOutputStrm.toString();
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

            MarshallerFactory marshallerFactory = org.opensaml.xml.Configuration.getMarshallerFactory();
            Marshaller marshaller = marshallerFactory.getMarshaller(xmlObject);
            Element element = marshaller.marshall(xmlObject);

            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);
            return byteArrayOutputStrm.toString();
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

     * @throws ClassNotFoundException
     * @throws InstantiationException
     * @throws IllegalAccessException
     */
    public static DOMImplementationLS getDomLsImplementation() throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
        return (DOMImplementationLS)registry.getDOMImplementation("LS");
    }
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

  Html5ElementStack stack;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    DOMImplementationRegistry registry =
        DOMImplementationRegistry.newInstance();
    DOMImplementation domImpl = registry.getDOMImplementation(
        "XML 1.0 Traversal 2.0");

    String qname = "html";
    String systemId = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";
    String publicId = "-//W3C//DTD XHTML 1.0 Transitional//EN";
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

        }
    }

    private void generateSchema(List<XSDefinition> definitions, XSDFactory factory, List<Type> types, String ns) {
        String schema = xsdHelper.generate(types);
        DOMImplementationRegistry registry = null;
        try {
            registry = DOMImplementationRegistry.newInstance();
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
        DOMImplementation impl = registry.getDOMImplementation("XML 3.0");
        DOMImplementationLS ls = (DOMImplementationLS)impl.getFeature("LS", "3.0");
        LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, SCHEMA_NS);
        LSInput input = ls.createLSInput();
        input.setCharacterStream(new StringReader(schema));
        Document document = parser.parse(input);
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

        }
    }

    private void generateSchema(List<XSDefinition> definitions, XSDFactory factory, List<Type> types, String ns) {
        String schema = xsdHelper.generate(types);
        DOMImplementationRegistry registry = null;
        try {
            registry = DOMImplementationRegistry.newInstance();
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
        DOMImplementation impl = registry.getDOMImplementation("XML 3.0");
        DOMImplementationLS ls = (DOMImplementationLS)impl.getFeature("LS", "3.0");
        LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, SCHEMA_NS);
        LSInput input = ls.createLSInput();
        input.setCharacterStream(new StringReader(schema));
        Document document = parser.parse(input);
View Full Code Here

Examples of org.w3c.dom.bootstrap.DOMImplementationRegistry

        }
    }

    private void generateSchema(List<XSDefinition> definitions, XSDFactory factory, List<Type> types, String ns) {
        String schema = xsdHelper.generate(types);
        DOMImplementationRegistry registry = null;
        try {
            registry = DOMImplementationRegistry.newInstance();
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
        DOMImplementation impl = registry.getDOMImplementation("XML 3.0");
        DOMImplementationLS ls = (DOMImplementationLS)impl.getFeature("LS", "3.0");
        LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, SCHEMA_NS);
        LSInput input = ls.createLSInput();
        input.setCharacterStream(new StringReader(schema));
        Document document = parser.parse(input);
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.