Package org.apache.batik.dom.svg

Examples of org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument()


        String docString = stringWriter.toString();
        System.err.println(">>>>>>>>>>> Document content \n\n" + docString + "\n\n<<<<<<<<<<<<<<<<");

        String parser = XMLResourceDescriptor.getXMLParserClassName();
        SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
        doc = f.createDocument("http://xml.apache.org/batik/foo.svg",
                               new StringReader(stringWriter.toString()));

        text = doc.getElementById("myText");
        cdata = (CDATASection)text.getFirstChild();
        if (cdata.getData().equals(unescapedContent)) {
View Full Code Here


     */
    protected TranscoderInput createTranscoderInput() {
        try {
            String parser = XMLResourceDescriptor.getXMLParserClassName();
            SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
            Document doc = f.createDocument(resolveURL(inputURI).toString());
            return new TranscoderInput(doc);
        } catch (IOException ex) {
            throw new IllegalArgumentException(inputURI);
        }
    }
View Full Code Here

        String parserClassName = XMLResourceDescriptor.getXMLParserClassName();
        SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parserClassName);
        Document doc = null;

        try {
            doc = f.createDocument(svgURL);
        } catch(IOException e){
            report.setErrorCode(ERROR_CANNOT_LOAD_SVG_DOCUMENT);
            report.addDescriptionEntry(ENTRY_KEY_ERROR_DESCRIPTION,
                                       e.getMessage());
            report.setPassed(false);
View Full Code Here

    }

    protected void loadImage() throws FopImageException {
        try {
            SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(SVGImage.getParserName());
            doc = factory.createDocument(this.m_href.toExternalForm());
        } catch (Exception e) {
            MessageHandler.errorln("ERROR LOADING EXTERNAL SVG: " +
                                   e.getMessage());
        }
    }
View Full Code Here

     */
    protected boolean loadImage(String uri) {
        // parse document and get the size attributes of the svg element
        try {
            SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(SVGImage.getParserName());
            SVGDocument doc = factory.createDocument(uri, imageStream);
            // should check the stream contains text data
            SVGSVGElement svg = doc.getRootElement();
            this.width =
              (int) svg.getWidth().getBaseVal().getValue();
            this.height =
View Full Code Here

    private static SVGElement parseSvg(final InputStream inputStream)
            throws IOException {
        String parser = XMLResourceDescriptor.getXMLParserClassName();
        SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
        SVGDocument document = (SVGDocument) f.createDocument("", inputStream);
        return (SVGElement) document.getDocumentElement();
    }

    private static File writeSvgToFile(final Document document,
            final File workingDir) throws IOException {
View Full Code Here

            if ((cookie != null) && cookie.length() > 0)
                urlCon.setRequestProperty("Cookie",cookie);

            InputStream stream = urlCon.getInputStream();
            doc = (SVGOMDocument)f.createDocument(url.toString(),stream);
            stream.close();
        }
        catch(IOException ex)
        {
            ex.printStackTrace();
View Full Code Here

            if ((cookie != null) && cookie.length() > 0)
                urlCon.setRequestProperty("Cookie",cookie);

            InputStream stream = urlCon.getInputStream();
            doc = (SVGOMDocument)f.createDocument(url.toString(),stream);
            stream.close();
        }
        catch(IOException ex)
        {
            ex.printStackTrace();
View Full Code Here

        try {
            // Parse the barChart.svg file into a Document.
            String parser = XMLResourceDescriptor.getXMLParserClassName();
            SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
            URL url = new URL(getCodeBase(), "barChart.svg");
            doc = f.createDocument(url.toString());

            svg = doc.getDocumentElement();

            // Change the document viewBox.
            svg.setAttributeNS(null, "viewBox", "40 95 370 265");
View Full Code Here

                urlObj = ((SVGOMDocument)bridgeContext.getDocument()).
                    getURLObject();
            }
            String uri = (urlObj==null)?"":urlObj.toString();
            try {
                Document d = df.createDocument(uri, new StringReader(text));
                if (doc == null)
                    return d;

                Node result = doc.createDocumentFragment();
                result.appendChild(doc.importNode(d.getDocumentElement(),
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.