Hmm...

I'm just clueless.  I'm modeling my x3d load class after the browser loading
code.  It uses:

VRMLUniverse universe = new VRMLUniverse(event_model,overlayHandler);
WorldLoader loader = worldLoaderManager.fetchLoader();
InputSource is = new InputSource(file);
VRMLScene parsed_scene = loader.loadNow(universe, is);

When I call loader.loadNow, somewhere in the XJ3D code, it is calling out to
X3DSAVAdapter, which checks the PUBLIC/SYSTEM ID against 2 values, neither of
which are "DTD/x3d-3.0.dtd".  The code you list is in a different class and is
not getting called by the above code.

Anyway, I've changed X3DSAVAdapter so that it allows "DTD/x3d-3.0.dtd", and it
work now :)

Mike



If my DTD declaration does not meet either of those, it bombs

Justin Couch wrote:
Michael P. McCutcheon wrote:

I suspect that if I can hack the X3DConstants so that
GENERAL_SYSTEM_ID_3_0 points to /DTD it will
work properly.  Note that this is with the .tar download of M6.

The question is, why should you need to do that in the first place? Your
classpath should be already pointing to the top of the installation
directory, which should, directly under it, have the DTD directory
already there. The appropriate code from the resolver is:

    public InputStream resolveDTDFromSystem(String uri) throws
IOException {

        InputStream ret_val = null;

        // grab the system ID and remove the last word from it prior to
        // a '/' (if one exists).
        int pos = uri.lastIndexOf('/');

        String filename = uri;

        if(pos != -1)
            filename = uri.substring(pos + 1);

        filename = "DTD/" + filename;

        return loadFile(filename);
    }

And

    public InputStream resolveDTDFromPublic(String id) throws IOException {

        String filename = (String)allowedPublicIDs.get(id);
        if(filename == null)
            return null;

        return loadFile(filename);
    }

where the Public ID listing is:

        allowedPublicIDs = new HashMap();
        allowedPublicIDs.put(X3DConstants.GENERAL_PUBLIC_ID_3_0,
                             "DTD/x3d-3.0.dtd");
        allowedPublicIDs.put(X3DConstants.INTERCHANGE_PUBLIC_ID_3_0,
                             "DTD/x3d-3.0.dtd");
        ...

So, the fact that it is not locating the DTD defintion file has
something to do with your local setup not being correct. You should
never have to hack the source code for it work out where to find the
files in a correctly set up system.

--
Justin Couch                         http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler              http://www.yumetech.com/
Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
                                              - Greg Bear, Slant
-------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to