[proposal] Don't rely on depth anymore for HeadingLevelSplittingCriterion

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[proposal] Don't rely on depth anymore for HeadingLevelSplittingCriterion

Simon Urli
Hi everyone,

I'm working on the document splitter in order to fix the following
issue: https://jira.xwiki.org/browse/XWIKI-13100

However I noticed that the current implementation of the document
splitter relies on the XDOM depth. That means if an user wants to split
a document with header level 1, the header blocks have to be under the
root of the document, they cannot be under a GroupBlocks, or as it's the
case in XWIKI-13100, under a NumberedListBlock.

Moreover, currently we do not rely at all on the header block level for
the splitting: if you have a header level 2 under the root and you
decided to split the document with header level 1, it will be splitted
since only the document depth is used.

So I propose to change this behaviour and to rely on HeaderBlock header
level *only* for the splitting criteria: the depth won't be used anymore.
In practice I propose to keep the API of SplittingCriterion which
defines the method with depth parameter, but to not rely on this
parameter in the HeadingLevelSplittingCriterion implementation, that we
rely on for splitting imported office document.

WDYT?

Simon
--
Simon Urli
Software Engineer at XWiki SAS
[hidden email]
More about us at http://www.xwiki.com