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


                System.exit(0);
            }
        }

        DocumentFactory df
            = new SAXDocumentFactory(SVGDOMImplementation.getDOMImplementation(),
                                     XMLResourceDescriptor.getXMLParserClassName());

        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

        /**
         * Loads the dummy testRun description
         */
        protected Document loadDummyTestRun() throws Exception{
            DocumentFactory df
                = new SAXDocumentFactory(SVGDOMImplementation.getDOMImplementation(),
                                         XMLResourceDescriptor.getXMLParserClassName());
           
            URL url = (new File(XMLTestSuiteRunnerValidator.dummyTestRun)).toURL();
            return df.createDocument(null,
                                     XTRunConstants.XTRun_TEST_RUN_TAG,
                                     url.toString(),
                                     url.openStream());

        }
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(),
                                     XMLResourceDescriptor.getXMLParserClassName());

        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

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

                    /* nothing - try something else*/
                }
            }

            // Parse as a generic XML document.
            SAXDocumentFactory sdf;
            if (doc != null) {
                sdf = new SAXDocumentFactory
                    (doc.getImplementation(),
                     XMLResourceDescriptor.getXMLParserClassName());
            } else {
                sdf = new SAXDocumentFactory
                    (new GenericDOMImplementation(),
                     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(),
View Full Code Here

   
    public TestReport runImpl() throws Exception {
        String parser =
            XMLResourceDescriptor.getXMLParserClassName();

        SAXDocumentFactory df =
            new SAXDocumentFactory
            (GenericDOMImplementation.getDOMImplementation(), parser);

        File f = (new File(testFileName));
        URL url = f.toURL();
        Document doc = df.createDocument(null,
                                         rootTag,
                                         url.toString(),
                                         url.openStream());
       
        Element e = doc.getElementById(targetId);
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.