You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Peppe <pe...@gmail.com> on 2006/11/09 15:45:42 UTC

what is the difference?

what is the difference between these methods?

DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
Document doc = impl.createDocument(svgNS, "svg", null);

and 

try {
    String parser = XMLResourceDescriptor.getXMLParserClassName();
    SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
    String uri = "http://...";
    Document doc = f.createDocument(uri);
} catch (IOException ex) 


if i must to load i svgfile and then i want to add new shape(rect,circle
ecc) to loaded file,  what method to use?
-- 
View this message in context: http://www.nabble.com/what-is-the-difference--tf2602076.html#a7259343
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: what is the difference?

Posted by th...@kodak.com.
Hi Peppe,

Peppe <pe...@gmail.com> wrote on 11/10/2006 07:01:44 AM:

> so, if i want to use the second one, how can i do to load file with
> JFileChooser and then use also SAXSVGDocumentFactory?

   Convert the file returned by the JFileChooser to a
URL (java.io.File.toURL()).  Then pass that to the createDocument
method.

> ...please, can you write code example?...

   No, requests like this are likely to get
your email's totally ignored.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: what is the difference?

Posted by Peppe <pe...@gmail.com>.
so, if i want to use the second one, how can i do to load file with
JFileChooser and then use also SAXSVGDocumentFactory?...please, can you
write code example?...thanks

-- 
View this message in context: http://www.nabble.com/what-is-the-difference--tf2602076.html#a7275611
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: what is the difference?

Posted by th...@kodak.com.
Hi Peppe,

Peppe <pe...@gmail.com> wrote on 11/09/2006 09:45:42 AM:

> what is the difference between these methods?
> 
> DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
> String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
> Document doc = impl.createDocument(svgNS, "svg", null);

    This creates an empty document.

> try {
>     String parser = XMLResourceDescriptor.getXMLParserClassName();
>     SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
>     String uri = "http://...";
>     Document doc = f.createDocument(uri);
> } catch (IOException ex) 

   This creates a document that is populated with the contents of
URI.  Once the document is created there isn't any real difference
(other than it's contents).

> if i must to load i svgfile and then i want to add new shape(rect,circle
> ecc) to loaded file,  what method to use?

   The second one.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org