Search in sources :

Example 1 with CellQuanVCTranslator

use of org.vcell.cellml.CellQuanVCTranslator in project vcell by virtualcell.

the class XmlHelper method importMathCellML.

public static VCDocument importMathCellML(VCLogger vcLogger, XMLSource xmlSource) throws Exception {
    // checks that the string is not empty
    if (xmlSource == null) {
        throw new XmlParseException("Invalid params for importing cellml model to Mathmodel.");
    }
    Document xmlDoc = xmlSource.getXmlDoc();
    String xmlString = XmlUtil.xmlToString(xmlDoc, false);
    CellQuanVCTranslator cellmlTranslator = new CellQuanVCTranslator();
    VCDocument vcDoc = cellmlTranslator.translate(new StringReader(xmlString), false);
    vcDoc.refreshDependencies();
    return vcDoc;
}
Also used : VCDocument(org.vcell.util.document.VCDocument) StringReader(java.io.StringReader) Document(org.jdom.Document) VCDocument(org.vcell.util.document.VCDocument) CellQuanVCTranslator(org.vcell.cellml.CellQuanVCTranslator)

Aggregations

StringReader (java.io.StringReader)1 Document (org.jdom.Document)1 CellQuanVCTranslator (org.vcell.cellml.CellQuanVCTranslator)1 VCDocument (org.vcell.util.document.VCDocument)1