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 Eyrignoux Marc <ey...@yahoo.fr> on 2002/11/07 09:26:11 UTC
Re[3]: Problem with DTD URL
Hi all,
Here is my code, which seems to work (I am using
Xerces):
// out is a ByteArrayOutputStream which contains the
// generated SVG stream
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder =
factory.newDocumentBuilder();
docBuilder.setEntityResolver(
new EntityResolver() {
public InputSource resolveEntity( String
publicId, String systemId ) {
URL url =
getClass().getClassLoader().getResource(
"org/apache/batik/dom/svg/resources/svg10.dtd" );
if ( url != null )
return new InputSource( url.toString()
);
else
return null;
}
}
);
ByteArrayInputStream in = new ByteArrayInputStream(
out.toByteArray() );
// the bug occured here: during the parsing, Xerces
// tried to get the DTD from the internet.
// But now it gets it from the jars of Batik.
Document svg = docBuilder.parse( in );
--- David Mechner <ba...@mechner.com> a écrit : >
Thanks!
>
> Will you announce to this list to let us know how to
> get that version?
> Also, will this be a static method that can be
> called before any batik
> objects are created and used (e.g.) by FOP
> processing SVG?
>
> Thanks,
>
> -David
>
>
> You wrote: VH> Hello,
>
> VH> I am currently updating that part of the code so
> that we can easily
> VH> specify a list of public identifiers for which
> Batik will load a local
> VH> system identifier instead of the one given in
> the SVG document. This is
> VH> what we already do for the SVG 1.0 public
> identifier, and this will be
> VH> extended (for SVG 1.1 but you could reuse the
> mechanism for your own
> VH> system identifiers even though that should not
> be needed if you use the
> VH> standard SVG 1.0 or 1.1 system ids).
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> batik-users-help@xml.apache.org
>
=====
C'est au pied du mur qu'on voit le mieux le mur.
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org