You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Uthus Ivan <Iv...@fellesdata.no> on 2001/01/16 16:09:45 UTC

DTD placement when using MemInputSources

Hello folks !

I'm using an MemBufInputSource, and I'm wondering where the parser looks for
the DTD when parsing with this kind of input source.  All my XML documents
have a filename (without a path) as an dtd (<!DOCTYPE IFX SYSTEM
"example.dtd">). I've looked in the docs, and can't find anything on this
issue.  I have been looking for it in the spec (the DOM level 1 spec and the
DOM level 2 core spec) as well, but it doesnt seem to include anything on
DTD placement or MemBufInputSource either...

Ivan Uthus

The Solution (was: DTD placement when using MemInputSources)

Posted by Joel Roth-Nater <jr...@quoininc.com>.
Here's my solution:

I've created a class that impelements the proposed XMLCatalog standard 
which allows looking up URIs for PubIDs and re-mapping SysIDs to another 
URI. It is configurable through an XML file of its own. Then I use a 
simple EntityResolver that delegates lookups to the catalog object.

In the attached archive there's also a URI class <shameless_plug> that 
is vastly superior to XMLURL </shameless_plug> which is needed 
internally by the catalog. Note that (except for the URI class) the 
files aren't a drop-in solution, as I've pretty much ripped them out of 
my source tree. E.g. somewhere you have to instantiate the objects and 
tell your parser to use them. Feel free to contact me with any 
questions. Maybe I'll package up a friendlier version if there's enough 
demand.

-- Joel

Reading in XML and fragment

Posted by "Gregory K. Pietsch" <gr...@babel.lz.att.com>.
Hello XML mavens,

What I want to do is read in an XML file and a fragment of an XML file and
determine if the fragment is a subset of the original XML file.  A DOM parser
has been suggested as the way to do this; I've got the general idea as to how to
do a recursive node comparison, but I do need some help.  Does anyone have any
ideas?

Sincerely, Gregory Pietsch