Alrighty...I've figured out what the problem is.  You'll notice that it's bombing out in the
startDTD method of the X3DSAVAdapter class (see exception below message).  In this method, it checks
the SYSTEM ID and the PUBLIC ID.  If they are not what is contained in the X3DConstants class, then
it throws an exception.  In the X3DConstants class, it defines a set of allowable values:

/** The formal system identifier for the specification V3.0 */
public static final String GENERAL_SYSTEM_ID_3_0 =
"http://www.web3d.org/specification/x3d/x3d-3.0.dtd";;
/** The old, transitional system Identifier for the specification */
public static final String OLD_SYSTEM_ID =
"/www.web3D.org/TaskGroups/x3d/translation/x3d-compact.dtd";

Then in the X3DSAVAdapter class, is has a list of allowable values for the  SYSTEM ID:

allowedSystemIDs = new HashSet();
allowedSystemIDs.add(X3DConstants.GENERAL_SYSTEM_ID_3_0);
allowedSystemIDs.add(X3DConstants.OLD_SYSTEM_ID);

Note that it only allows these 2 SYSTEM IDs and NONE others.  See the method below (note the last line).

public void startDTD(String name, String publicId, String systemId)
    throws SAXException {
     if(!name.equals(X3DConstants.DTD_NAME))
        throw new SAXNotSupportedException(INVALID_DTD_NAME_MSG + name);
     if(allowedPublicIDs.contains(publicId)) {
        if(X3DConstants.OLD_PUBLIC_ID.equals(publicId))
            errorReporter.warningReport(TRANSITIONAL_HEADER_MSG, null);
    } else
        throw new SAXException(INVALID_PUBLIC_ID_MSG);
     if(allowedSystemIDs.contains(systemId)) {
        if(X3DConstants.OLD_SYSTEM_ID.equals(systemId))
            errorReporter.warningReport(TRANSITIONAL_HEADER_MSG, null);
    } else
        throw new SAXException(INVALID_SYSTEM_ID_MSG);
}

In the end, I WAS able to make it work IF I put this on my filesystem on the base directory of my
program:

\www.web3d.org\TaskGroups\x3d\translation\x3d-compact.dtd

This makes it so that the startDTD method does not throw the exception on the last line (that is,
the allowedSystemIDs.contains(systemId) returns true)...But this is the old version of the DTD.
Also I don't see why it forces you to put it in these directories...perhaps something got overlooked?

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 code I'm looking at is from a
CVS 'get' of M6.  In other words, I'm using the precompiled jars, but looking at the code from CVS.

Anyway, I'm glad I finally got it partly working...but if we can resolve the SYSTEM ID issue, all
will be well.  I'm trying to put together an XML demo for the US Navy.  I'm trying to show how it is
possible to take an XML document containing data, then through 2 style sheets, translate the data
XML into SVG and X3D.

Mike

Here is the exception:

org.web3d.vrml.lang.VRMLException: SAX Error: org.xml.sax.SAXException: The SYSTEM ID provided is wr
ongorg.xml.sax.SAXException: The SYSTEM ID provided is wrong
        at org.web3d.x3d.jaxp.X3DSAVAdapter.startDTD(X3DSAVAdapter.java:370)
        at org.apache.xerces.parsers.AbstractSAXParser.doctypeDecl(AbstractSAXParser.java:282)
        at org.apache.xerces.impl.XMLNamespaceBinder.doctypeDecl(XMLNamespaceBinder.java:484)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.doctypeDecl(XMLDTDValidator.java:755)
        at org.apache.xerces.impl.XMLDocumentScannerImpl.scanDoctypeDecl(XMLDocumentScannerImpl.java
:487)
        at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocumentScanne
rImpl.java:698)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentSca
nnerImpl.java:333)
        at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.j
ava:529)
        at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.j
ava:585)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1148)
        at org.web3d.parser.GeneralisedReader.parse(GeneralisedReader.java:204)
        at org.web3d.vrml.nodes.loader.DefaultWorldLoader.loadNow(DefaultWorldLoader.java:144)
        at org.web3d.vrml.nodes.loader.DefaultWorldLoader.loadNow(DefaultWorldLoader.java:95)
        at org.mikemccutcheon.sandbox.java3d.cubeworld.X3DUtil.loadX3D(X3DUtil.java:142)
        at org.mikemccutcheon.sandbox.java3d.cubeworld.TestWorldBranch.init(TestWorldBranch.java:246
)




Justin Couch wrote:
Michael P. McCutcheon wrote:

Well, we're at least we're getting closer :)

It seems that the DTD being pointed to is not valid.

Now I'm getting the following error with the file you gave me:

Fatal Error: URI=http://www.web3d.org/specification/x3d/x3d-3.0.dtd
Line=1: The markup declarations
contained or pointed to by the document type declaration must be

My gut feeling says that this is because the file does not exist on the
web3d.org server and it is attempting to parse the 404 HTML error page
that is returned. Try pulling up that URL in an ordinary web browser and
see what happens.

The real question is - why is your code attempting to look at the
web3d.org webserver in the first place? You should be fetching these
files from the local disk as we include them as part of the distribution
in the DTD directory. The batch files that run the stock browser points
to '.', which is the xj3d install dir. The resolver we use internally
looks for a directory ./DTD to grab the DTD files from. So, for the
standard setup, everything works fine. If you are not using the standard
setup, then you will need to make sure your classpath is pointing to the
root of the Xj3D install area so that it picks these files up.
Alternatively, you can create a JAR file that holds these DTD files in a
subdirectory called DTD in the JAR and make sure that is in the
classpath. Either way, that should make sure that we resolve them
properly and you don't have to go off to the external site.

--
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