Logo Search packages:      
Sourcecode: cdk version File versions  Download package

InputSource org::openscience::cdk::io::cml::CMLResolver::getCMLType ( String  type  )  [inline, private]

Returns an InputSource of the appropriate CML DTD. It accepts two CML DTD names: cml1_0.dtd and cml1_0_1.dtd. Returns null for any other name.

Parameters:
type the name of the CML DTD version
Returns:
the InputSource to the CML DTD

Definition at line 99 of file CMLResolver.java.

References org::openscience::cdk::tools::LoggingTool::debug(), and org::openscience::cdk::tools::LoggingTool::error().

Referenced by resolveEntity().

                                                  {
        try {
            InputStream ins = this.getClass().getClassLoader().getResourceAsStream("org/openscience/cdk/io/cml/data/" + type);
            return new InputSource(new BufferedReader(new InputStreamReader(ins)));
        } catch (Exception e) {
            logger.error("Error while trying to read CML DTD (" + type + "): ",
                         e.getMessage());
            logger.debug(e);
            return null;
        }
    }


Generated by  Doxygen 1.6.0   Back to index