From: Chen Li <ch...@eb...> - 2009-04-08 10:05:08
|
Hello, Anuradha & Dan, Could you please send me your code for retrieving the model and generating JDOM document object? I did a test with the models including these three (2, 21, 32) by following your description to retrieve models, create JDOM document object and open them in IE. But I couldn't repeat the error. And BTW, which version of JDOM did you use? Regards, Chen Lakshminarayana,Anuradha wrote: > > Hi, > > We are developers for the Virtual Cell project. We are using the > Biomodels.net Web Services to retrieve an SBML model given its 'id' > (using BioModelsWSClient.getModelSBMLById() which returns the xml > string for the SBML model). When we try to use SAXBuilder and create a > JDOM document (or a XOM document) with the string (converted to an > InputStream), the document is not created – an exception is thrown > saying "Error on line XX: Invalid byte 2 of 3-byte UTF-8 sequence" > (the line no. XX depends which model is being read - we tried > Biomodels.net models 2, 21, 32). > > We saved the xml string returned from a call to > BioModelsWSClient.getModelSBMLById() and tried opening it with > Internet Explorer, and we get the message > > "The XML Page cannot be displayed" : > > "An invalid character was found in text content. Error processing > resource 'file:///C:/MIASE/tempSBML.xml'. Line 6, Positio... > > <p>This model originates from BioModels Database: A Database of > Annotated Published Models. It is copyright (c... > > We tried accessing the biomodel through its URL > "http://www.ebi.ac.uk/biomodels/models-main/publ/BIOMD0000000021.xml" > (and java.net libraries). This time, we were able to get read in the > string and create a JDOM document with the string, but opening the > string in Internet Explorer caused the same error as above (different > line #). > > The funny part is, if we use this same xml string to import into > Virtual Cell, there is no problem (while importing, we use the libSBML > libraries and the string is read in with the SBMLReader class and > converted to an SBMLDocument, there is no problem with the string or > the conversion). > > The same model when saved from Biomodels.net list of curated models > does not have a problem, but we need to access it through the web > either through the Biomodels web servies or through the URL. > > Do you know why this is happening? Could it be an issue with locales > (UK, where the model in the database was created, vs USA where I am > trying to retrieve it? - sounds silly, but I couldn't think of > anything else ....). Do you know if anyone else has had such a > problem? Is there a workaround you can suggest so that the XML string > is not a problem? Are there any other ways (other than > BioModelsWSClient) to get a model (xml string) given its 'id', using > the web services? > > Thanks in advance for your time, > > Sincerely, > > Anuradha & Dan. > |