NMFCode / NMF

This repository contains the entire code for the .NET Modeling Framework
BSD 3-Clause "New" or "Revised" License
36 stars 15 forks source link

"Data at root level is invalid. Line 1, position 1." #60

Closed RobertWalterU3d closed 2 years ago

RobertWalterU3d commented 4 years ago

Hello,

so I went a step back and created a Console Application according to the First Steps video tutorial.

There, I am able to create the Model Repository, but trying to actual resolve a model from the repo, yields this exception. Any clues on why this could be the case?

" at System.Xml.XmlTextReaderImpl.Throw(Exception e)\r\n at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)\r\n at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()\r\n at System.Xml.XmlTextReaderImpl.ParseDocumentContent()\r\n at System.Xml.XmlTextReaderImpl.Read()\r\n at NMF.Serialization.XmlSerializer.CreateRoot(XmlReader reader)\r\n at NMF.Models.Repository.Serialization.ModelSerializer.Deserialize(Stream source, Uri modelUri, IModelRepository repository, Boolean addToRepository)\r\n at NMF.Models.Repository.ModelRepository.Resolve(Uri uri, String hintPath, Boolean loadOnDemand)\r\n at NMF.Models.Repository.ModelRepository.Resolve(String path)\r\n at StoryGraphMetamodelConverter.Program.Main(String[] args) in D:\MyPath\dev\StoryGraphMetamodelConverter\Program.cs:line 15"

RobertWalterU3d commented 4 years ago

Okay, I just realized I might have a general misconception of what the models need to look like in order to load them: I use a Xtext grammar for a textual DSL. I assume now that NMF needs a serialzed AST in some sort of XML format as an input to load the model, right? Do you happen to know how I can serialize the AST?