You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Oleg Tkachenko <ol...@multiconn.com> on 2002/07/24 20:20:10 UTC

Re: http get to w3.org?

David Mechner wrote:

> I'm using Xalan/Xerces/FOP/Batik to generate PDF reports including SVG
> graphics. I noticed that each time a report is generated, at some
> point in the process an http connection to w3.org is made. For some
> reason I think it's to retrieve the svg .dtd, but I'm not sure.

Well, it could be dtd. By default parsers load the DTD and use it to add 
default attributes and set attribute types, so probably that's the case.
Your options:
o change uri to a local copy of the dtd
o turn off dtd loading in your parser (e.g. 
http://apache.org/xml/features/nonvalidating/load-dtd-grammar feature if you 
are using xerces)
o use XML Catalog + Norm Walsh's URIResolvers to redirect parser to a local 
resource.

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


Re[2]: http get to w3.org?

Posted by David Mechner <fo...@mechner.com>.
Thanks for the response.

I decided your first suggestion looks by far the simplest.

>From my reading of the batik docs the following is supposed
to do the trick:

DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
String svgNS = "file:///c:/gra/svg10.dtd";
Document doc = impl.createDocument(svgNS, "svg", null);

(instead of createDocument(null, "svg", null))

However, supplying the local file svgNS URI seems to have no effect on
the generated svg doc.

It still starts out:

<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>

Am I misunderstanding?

Thanks,
-David


You wrote:
OT> David Mechner wrote:

>> I'm using Xalan/Xerces/FOP/Batik to generate PDF reports including SVG
>> graphics. I noticed that each time a report is generated, at some
>> point in the process an http connection to w3.org is made. For some
>> reason I think it's to retrieve the svg .dtd, but I'm not sure.

OT> Well, it could be dtd. By default parsers load the DTD and use it to add 
OT> default attributes and set attribute types, so probably that's the case.
OT> Your options:
OT> o change uri to a local copy of the dtd
OT> o turn off dtd loading in your parser (e.g. 
OT> http://apache.org/xml/features/nonvalidating/load-dtd-grammar feature if you 
OT> are using xerces)
OT> o use XML Catalog + Norm Walsh's URIResolvers to redirect parser to a local 
OT> resource.


Re: http get to w3.org?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Oleg Tkachenko wrote:
>> Better yet, copy the namespace declaration into your SVG
>> and delete the DOCTYPE completely.
> 
> Well, you one is able to do that, but if not - using OASIS XML Catalogs 
> could be extremely handy in such a situation. I learned that developing 
> some stuff using docbook website dtd: along with the same dtd loading 
> problem (you know, docbook dtd is not a small fry) there was a jazz like
> <xsl:import 
> href="http://docbook.sourceforge.net/release/xsl/current/html/chunker.xsl"/>, 
> so then Norm and others at docbook-apps pointed me out "the right way" - 
> XML Entity and URI Resolvers 
> http://wwws.sun.com/software/xml/developers/resolver/article.
> 
Well, the SVG DTD is not small either, and not really necessary
for processing SVG, except for the namespace attribute (duh!).
Certainly not an issue for casual processing, but I'd delete the
DTD reference for heavy duty service, it takes some non-trivial
amount of time just to load the file even from a local disc.


J.Pietschmann


Re: http get to w3.org?

Posted by Oleg Tkachenko <ol...@multiconn.com>.
J.Pietschmann wrote:

>> o turn off dtd loading in your parser (e.g. 
>> http://apache.org/xml/features/nonvalidating/load-dtd-grammar feature 
>> if you are using xerces)
> 
> Not recommended, because the SVG DTD has the nasty habit
> of defining the SVG namespace as an attribute to the svg
> element.
> 
> Better yet, copy the namespace declaration into your SVG
> and delete the DOCTYPE completely.
Well, you one is able to do that, but if not - using OASIS XML Catalogs 
could be extremely handy in such a situation. I learned that developing 
some stuff using docbook website dtd: along with the same dtd loading 
problem (you know, docbook dtd is not a small fry) there was a jazz like
<xsl:import 
href="http://docbook.sourceforge.net/release/xsl/current/html/chunker.xsl"/>, 
so then Norm and others at docbook-apps pointed me out "the right way" - 
XML Entity and URI Resolvers 
http://wwws.sun.com/software/xml/developers/resolver/article.

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


Re: http get to w3.org?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Oleg Tkachenko wrote:
> o turn off dtd loading in your parser (e.g. 
> http://apache.org/xml/features/nonvalidating/load-dtd-grammar feature if 
> you are using xerces)
Not recommended, because the SVG DTD has the nasty habit
of defining the SVG namespace as an attribute to the svg
element.

Better yet, copy the namespace declaration into your SVG
and delete the DOCTYPE completely.

J.Pietschmann