Lists Home |
Date Index |
- From: Russell East <firstname.lastname@example.org>
- To: xml-dev Mailing List <email@example.com>
- Date: Wed, 17 Dec 1997 18:50:04 -0800
Antony Blakey wrote:
> .... What we need to do is ... provide the
> input stream from within the program ie. the entity is stored as a string, or accessed
> through ClassLoader.getResourceAsStream()...
Yes! I would like to be able to store one or more DTDs as
resources within a JAR file. Within a <!doctype ... SYSTEM "URL">
I'd like to be able to refer to that DTD, rather than, refering
to some server-side DTD. But, I don't think we can do this now, because,
we can't specify a URL for a JAR resource - well, we can't do it in a
platform independent manner anyway, because JavaSoft states, at
"The method getResource() returns a URL for the resource.
The URL (and its representation) is implementation-specific
and may vary depending on the implementation details (it may
also change between JDK1.1 and JDK1.1.1). Its protocol is
(usually) specific to the ClassLoader loading the resource.
If the resource does not exist, a null will be returned."
It's hard to test this, firstly Netscape doesn't yet seem to support
ClassLoader.getResource() and IE4 doesn't seem to support JARs as
containers for resources. For instance, I have a sample applet which
is placed into a JAR along with a resource named test.dtd. Within
JDK 1.1.4 appletviewer, getResource() returns the URL of this
resource as: appletresource:/file:/D:/Ims/z//+/test.dtd
or : appletresource://gumnut/http://gumnut/ims/z//+/test.dtd
depending on whether I access the HTML thru my webserver or not.
It would be good to be able to specify one of these URLs in SYSTEM,
and have it work in all cases - not just appletviewer.
Do the XML parser developers have any suggestions on how to achieve this?
Does it make sense to have a special API for the parser through which
you can not only specify an xml document, but also a separate dtd ?
Russell East mailto:firstname.lastname@example.org
_|_| Programmer phn: +1 (909) 793 2853
_|_| ESRI, 380 New York St fax: +1 (909) 307 3067
Redlands CA 92373-8100 http://maps.esri.com/
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)