Open-Xml-PowerTools and JavaScript
One issue that many Open XML developers face when doing Open XML development in JavaScript is the need for many of the important modules available in Open-Xml-PowerTools.
To date, almost none of the Open-Xml-PowerTools have been converted to JavaScript (in a publicly releasable form).
However, I designed the Open-Xml-Sdk for JavaScript with the specific intention to enable manual conversion of Open-Xml-PowerTools code from C# to JavaScript. The Ltxmljs library is semantically compatible with the .NET LINQ to XML library. The Open-Xml-Sdk for JavaScript was designed with the idea that the common idioms that we use in the Open-Xml-Sdk can be converted to JavaScript with ease.
Proof-in-the-pudding is that I converted thousands of lines of code (of a preliminary version of the WmlToHtmlConverter) to JavaScript. This included the FormattingAssembler module, the ListItemRetriever module, the HtmlConverter module, and more. It worked very nicely. However, because this was based on a half-baked WmlToHtmlConverter, I decided that I wanted to first polish those modules as written in C#, and then at some future point in time convert the finished modules to JavaScript. I fully expect to convert these modules to JavaScript (but it is not going to happen in the near future, as my current projects prohibit an effort of this magnitude).
Key points:
- It is doable.
- It is non-trivial. You should be expert in C#, HTML, CSS, JavaScript, LINQ to XML, functional programming, and Open XML markup. I don’t want to minimize what you must know in order to tackle conversion of one of these modules to JavaScript.
But it is doable. I have a goal to do this, but it must fit in with other priorities in my life, like keeping my kid and wife with groceries. 🙂
Cheers, Eric