Package org.apache.batik.dom.svg

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


   public static SVGOMDocument createDocument (Reader reader, String dummyURI)
      throws IOException
   {
      SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(PARSER_CLASSNAME);
      return (org.apache.batik.dom.svg.SVGOMDocument)factory.createDocument(dummyURI, reader);
   }


   public static SVGOMDocument createDocument (InputStream inputStream, String dummyURI)
      throws IOException
View Full Code Here


   public static SVGOMDocument createDocument (InputStream inputStream, String dummyURI)
      throws IOException
   {
      SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(PARSER_CLASSNAME);
      return (org.apache.batik.dom.svg.SVGOMDocument)factory.createDocument(dummyURI, inputStream);
   }


   public static SVGOMDocument createDocument (String xmlString, String dummyURI) throws IOException
   {
View Full Code Here

                (XMLResourceDescriptor.getXMLParserClassName());
            String uri = ((SVGOMDocument)bridgeContext.getDocument()).
                getURLObject().toString();
            DocumentFragment result = null;
            try {
                Document d = df.createDocument(uri, new StringReader(text));
                result = doc.createDocumentFragment();
                result.appendChild(doc.importNode(d.getDocumentElement(),
                                                  true));
            } catch (Exception ex) {
                StringBuffer sb = new StringBuffer(text.length() +
View Full Code Here

                sb.append(FRAGMENT_PREFIX);
                sb.append(text);
                sb.append("</svg>");
                String newText = sb.toString();
                try {
                    Document d = df.createDocument
                        (uri, new StringReader(newText));
                    for (Node n = d.getDocumentElement().getFirstChild();
                         n != null;
                         n = n.getNextSibling()) {
                        if (n.getNodeType() == n.ELEMENT_NODE) {
View Full Code Here

        SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parserClassName);
        f.setValidating(validate.booleanValue());
        Document doc = null;

        try {
            doc = f.createDocument(svgURL);
        } catch(Exception e){
            return handleException(e);
        }

        //
View Full Code Here

                (XMLResourceDescriptor.getXMLParserClassName());
            String uri = ((SVGOMDocument)bridgeContext.getDocument()).
                getURLObject().toString();
            DocumentFragment result = null;
            try {
                Document d = df.createDocument(uri, new StringReader(text));
                result = doc.createDocumentFragment();
                result.appendChild(doc.importNode(d.getDocumentElement(),
                                                  true));
            } catch (Exception ex) {
                StringBuffer sb = new StringBuffer(text.length() +
View Full Code Here

                sb.append(FRAGMENT_PREFIX);
                sb.append(text);
                sb.append("</svg>");
                String newText = sb.toString();
                try {
                    Document d = df.createDocument
                        (uri, new StringReader(newText));
                    for (Node n = d.getDocumentElement().getFirstChild();
                         n != null;
                         n = n.getNextSibling()) {
                        if (n.getNodeType() == n.ELEMENT_NODE) {
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 = (int)svg.getHeight().getBaseVal().getValue();
            return true;
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

        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

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.