Package org.apache.batik.dom.util

Examples of org.apache.batik.dom.util.SAXDocumentFactory


     * @param domImpl the DOM Implementation to use
     * @param parserClassname the XML parser classname
     */
    protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
                                                    String parserClassname) {
        return new SAXDocumentFactory(domImpl, parserClassname);
    }
View Full Code Here


     * Loads the URI as a <tt>Document</tt>
     */
    protected static Document loadTestSuiteDocument(String testSuiteURI)
        throws TestException{
        DocumentFactory df
            = new SAXDocumentFactory(SVGDOMImplementation.getDOMImplementation(),
                                     Messages.formatMessage(XML_PARSER, null));

        Document doc = null;

        try{
            URL url = new URL(testSuiteURI);
            doc = df.createDocument(null,
                                    XTS_TEST_SUITE_TAG,
                                    url.toString(),
                                    url.openStream());
        }catch(Exception e){
            StringWriter sw = new StringWriter();
View Full Code Here

                System.exit(0);
            }
        }

        DocumentFactory df
            = new SAXDocumentFactory(SVGDOMImplementation.getDOMImplementation(),
                                     Messages.formatMessage(XML_PARSER, null));

        Document doc = null;

        try{
            System.err.println("Loading document ...");
            doc = df.createDocument(null,
                                    XTRun_TEST_RUN_TAG,
                                    url.toString(),
                                    url.openStream());
        }catch(Exception e){
            e.printStackTrace();
View Full Code Here

     * @param domImpl the DOM Implementation to use
     * @param parserClassname the XML parser classname
     */
    protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
                                                    String parserClassname) {
  return new SAXDocumentFactory(domImpl, parserClassname);
    }
View Full Code Here

                    /* nothing */
                }
            }

            // Parse as a generic XML document.
                    SAXDocumentFactory sdf = new SAXDocumentFactory
                        (doc.getImplementation(),
                         XMLResourceDescriptor.getXMLParserClassName());
                    try {
                Document d = sdf.createDocument(uri, new StringReader(text));
                if (doc == null)
                    return d;

                Node result = doc.createDocumentFragment();
                        result.appendChild(doc.importNode(d.getDocumentElement(), true));
View Full Code Here

         * The stream is assumed to be using the ISO 8859-1 character encoding.
         */
        public synchronized void load(InputStream is) throws IOException {
            BufferedReader r;
            r = new BufferedReader(new InputStreamReader(is, PREFERENCE_ENCODING));
            DocumentFactory df = new SAXDocumentFactory
                (GenericDOMImplementation.getDOMImplementation(),
                 xmlParserClassName);
            Document doc = df.createDocument("http://xml.apache.org/batik/preferences",
                                             "preferences",
                                             null,
                                             r);
            Element elt = doc.getDocumentElement();
            for (Node n = elt.getFirstChild(); n != null; n = n.getNextSibling()) {
View Full Code Here

        // Generic Document
        {
            String parser = XMLResourceDescriptor.getXMLParserClassName();
            DOMImplementation impl =
                GenericDOMImplementation.getDOMImplementation();
            SAXDocumentFactory f = new SAXDocumentFactory(impl, parser);
            Document doc = f.createDocument(TEST_URI);
            TranscoderInput ti = new TranscoderInput(doc);
            ti.setURI(TEST_URI);
            t = new TestTranscoder();
            t.transcode(ti, out);
            assertTrue(t.passed);
View Full Code Here

  try {
      URL url = resolveURL(inputURI);
            String parser = XMLResourceDescriptor.getXMLParserClassName();
            DOMImplementation impl =
                GenericDOMImplementation.getDOMImplementation();
            SAXDocumentFactory f = new SAXDocumentFactory(impl, parser);
            Document doc = f.createDocument(url.toString());
      TranscoderInput input = new TranscoderInput(doc);
      input.setURI(url.toString()); // Needed for external resources
      return input;
  } catch (IOException ex) {
            ex.printStackTrace();
View Full Code Here

     * @param domImpl the DOM Implementation to use
     * @param parserClassname the XML parser classname
     */
    protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
                                                    String parserClassname) {
        return new SAXDocumentFactory(domImpl, parserClassname);
    }
View Full Code Here

         * The stream is assumed to be using the ISO 8859-1 character encoding.
         */
        public synchronized void load(InputStream is) throws IOException {
            BufferedReader r;
            r = new BufferedReader(new InputStreamReader(is, PREFERENCE_ENCODING));
            DocumentFactory df = new SAXDocumentFactory
                (GenericDOMImplementation.getDOMImplementation(),
                 xmlParserClassName);
            Document doc = df.createDocument("http://xml.apache.org/batik/preferences",
                                             "preferences",
                                             null,
                                             r);
            Element elt = doc.getDocumentElement();
            for (Node n = elt.getFirstChild(); n != null; n = n.getNextSibling()) {
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.util.SAXDocumentFactory

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.