I thought I would attempt to use ProseMirror to edit some XML. I understand that I need to create a custom ProseMirror schema to represent my XML structure.
I decided to try and make a small tool to convert XML Schema to ProseMirror schema. You can see the current progress here: https://github.com/adamretter/prosemirror-xml-schemagen
My experiments so far have focused on DocBook v4.5 as it is a very complex XML Schema and so will be a challenged, whether in practice it is possible to use such a complex schema with ProseMirror I am not yet sure.
I have a couple of questions:
Attributes. In XML Schema attributes can be optional or required. It seems to me that there is no way to say that an Attribute in ProseMirror schema is optional? It seems that ProseMirror requires an attribute to be completed explicitly by the editor or implicitly by a default value in the ProseMirror schema. So, er, how can I model optional attributes from XML in ProseMirror schema?
“inline”. The documentation for XML Schema is quite basic, and I don’t really understand what the definition of “inline” means. Could someone explain it to me in terms of XML perhaps? Does it mean that an inline node can have text content, or makes up mixed-content, or what?
Marks. I just don’t understand at all what these are for and why I need to have them in the Schema.