aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/image/XMLImage.java
blob: a6e47df5061912a4a5415da72e711c063b5d4ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * $Id$
 * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
 * For details on use and redistribution please refer to the
 * LICENSE file included with these sources.
 */

package org.apache.fop.image;

// Java
import java.net.URL;
import org.w3c.dom.Document;

// FOP
import org.apache.fop.apps.Driver;
import org.apache.fop.image.analyser.ImageReader;
import org.apache.fop.image.analyser.SVGReader;
import org.apache.fop.fo.FOUserAgent;

/**
 * @see AbstractFopImage
 * @see FopImage
 */
public class XMLImage extends AbstractFopImage {
    Document doc;
    String ns = "";

    public XMLImage(URL href, FopImage.ImageInfo imgInfo) {
        super(href, imgInfo);
        if(imgInfo.data instanceof Document) {
            doc = (Document)imgInfo.data;
        }
        ns = imgInfo.str;
    }

    /**
     * creates a SAX parser, using the value of org.xml.sax.parser
     * defaulting to org.apache.xerces.parsers.SAXParser
     *
     * @return the created SAX parser
     */
    public static String getParserName() {
        String parserClassName = Driver.getParserClassName();
        return parserClassName;
    }

    protected boolean loadData(FOUserAgent ua) {
        return true;
    }

    public Document getDocument() {
        return doc;
    }

    public String getNameSpace() {
        return ns;
    }
}