Hello all,
Would you be interested in an alternative serialization format for the Migradoc Document?
Rationale:
- need to replace the reporting engine of an aging application with a full featured, template driven, no bells and whistles pdf generator tool.
- MigraDoc & PDFSharp ( + Mustache for data ) fit that scenario but...
- ... proprietary DDL language is an issue for us ( readability issues, unfamiliar syntax, lack of formatting tools, lack of a schema, etc )
After a few testing an alternative serializer implementation has been developed using an xml variant of the original ddl with the following features in mind:
- xml is the language of choice for the template. plain xml template is a bit more verbose, but it's well understood by our non-tech team members and has a more familiar syntax.
- original syntax/sugar elements should be preserved ( use CDATA wherever possibile)
- mustache specific data template elements to be injected into the template. Template must be be parseable by a conformant xml parser.
- the serializer/parser feature must sit on top without disrupting the code base wherever possibile.
- extend the template syntax ( e.g. external styles )
Key changes so far:
class DocumentObject:
new method:
internal abstract void Serialize(XmlSerializer serializer);new package:
MigraDoc.DocumentObjectModel.IO.Xml
implementation:
https://github.com/emazv72/MigraDocSample serialization code ( HelloMigraDoc )
MigraDoc.DocumentObjectModel.IO.Xml.DdlWriter.WriteToFile(document, "MigraDoc.xml");
Sample xml template: see attached file.
Still missing:
- Serializer needs to use fragments to compact nodes ( review the stack/commit feature in the Serializer class)
- Parser code is still missing
Any comment or idea is welcome
Thank you.