[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

a DTD as a JAR file resource [was Re: RFC: Simple XML Event-Based API fo

  • From: Russell East <reast@e...>
  • To: xml-dev Mailing List <xml-dev@i...>
  • Date: Wed, 17 Dec 1997 18:50:04 -0800

dtd jar
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
http://java.sun.com/products/jdk/1.1/docs/guide/misc/resources.html :

 "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:reast@e...
 _|_|  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:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.