Vitaliy-1 / docxToJats

DOCX to JATS XML Converter
GNU General Public License v3.0
20 stars 7 forks source link

Traverse style chain instead of taking the first style name directly #10

Closed sjamaan closed 4 years ago

sjamaan commented 4 years ago

Users can define their own styles, which may inherit from built-in styles. This results in a style chain (the built-in headings also inherit from the "standard" style, for example). To find if a style is a heading, we must traverse this chain (see also L.1.8.9 Style Inheritance in ECMA-376) .

In this commit, I've also removed the comment about figuring out if languages use the same builtins. It appears Dutch Word versions also use the English names like "heading 2" as builtin. Strangely, its parent style is called "Standaard", which is Dutch again.

Vitaliy-1 commented 4 years ago

OOXML is much a mystery to me :) I definitely need to read the standards. Thanks, I'll take a look.

sjamaan commented 4 years ago

I can't promise anything; I was using this code for a client and we've decided to switch to a different implementation in the meantime. If I find the time I can take a look.

Vitaliy-1 commented 4 years ago

Not a problem, I'll apply necessary changes.